Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

block /air for bombardier


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
6 odpowiedzi w tym temacie

#1 totoff

    Zaawansowany

  • Użytkownik

Reputacja: 1
Nowy

  • Postów:122
  • Imię:christophe
  • Lokalizacja:france
Offline

Napisano 04.12.2011 11:38

hello,

when one is dead and that we make / air bomber works and I want blocking / air when oneis dead

thank you



#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "KillStreak"
#define VERSION "1.0"
#define AUTHOR "cypis"
new sprite_blast;
new PobraneOrigin[3];
new g_bomby[15]
new g_use
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_forward(FM_Touch, "fw_Touch");
register_logevent("RundStart", 2, "1=Round_Start");

register_clcmd("say /air", "CreateNalot")
}
public plugin_precache()
{
sprite_blast = precache_model("sprites/dexplo.spr")
precache_model("models/p_hegrenade.mdl");
precache_model("models/Mig29.mdl");
precache_sound("mw/jet_fly1.wav");
}
public RundStart()
{
client_print(0, print_chat, "Tu as le droit a un bombardement par round, pointe ton viseur ou tu veut lancer le bombardement puis tape /air");
g_use = 1
}
public fw_Touch(ent, id)
{
if (!pev_valid(ent))
return FMRES_IGNORED

new EntClassName[32]
entity_get_string(ent, EV_SZ_classname, EntClassName, charsmax(EntClassName))
if(equal(EntClassName, "Bomb"))
{
bombs_explode(ent, 100, 150)
remove_entity(ent)
return FMRES_IGNORED
}
return FMRES_IGNORED
}
public CreateNalot(id)
{
if(!g_use)
return;
CreatePlane(id)
set_task(1.0, "CreateBombs", id+997, "", 0, "a", 3)
set_task(6.0, "remove_ent")
g_use--;
}
public remove_ent()
remove_entity_name("Samolot");
public CreatePlane(id){
new Float:Origin[3], Float: Velocity[3];
get_user_origin(id, PobraneOrigin, 3);
entity_get_vector(id, EV_VEC_origin , Origin);
Origin[2] = Origin[2] + 250;

new Float: vAngle[3];
entity_get_vector(id, EV_VEC_v_angle, vAngle);

vAngle[0] *= -1.0;

new g_samolot = create_entity("info_target");
entity_set_string(g_samolot, EV_SZ_classname, "Samolot");
entity_set_int(g_samolot, EV_INT_solid, 2);
entity_set_int(g_samolot, EV_INT_movetype, 8);
entity_set_edict(g_samolot, EV_ENT_owner, id);
entity_set_model(g_samolot, "models/Mig29.mdl");
entity_set_origin(g_samolot, Origin);
entity_set_vector(g_samolot, EV_VEC_angles, vAngle);
VelocityByAim(id, 1000 , Velocity);
Velocity[2] = Origin[2];
entity_set_vector(g_samolot, EV_VEC_velocity ,Velocity);

emit_sound(g_samolot, CHAN_ITEM, "mw/jet_fly1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
}
public CreateBombs(taskid)
{
new id = (taskid-997)
new radlocation[3];
new randomx;
new randomy;
PobraneOrigin[2] += 50;

for(new i=0; i<15; i++)
{
randomx = random_num(-150,150);
randomy = random_num(-150,150);

radlocation[0] = PobraneOrigin[0]+1*randomx;
radlocation[1] = PobraneOrigin[1]+1*randomy;
radlocation[2] = PobraneOrigin[2];
new Float:LocVec[3];
IVecFVec(radlocation, LocVec);

g_bomby[i] = create_entity("info_target");
entity_set_string(g_bomby[i], EV_SZ_classname, "Bomb");
entity_set_int(g_bomby[i], EV_INT_solid, 2);
entity_set_int(g_bomby[i], EV_INT_movetype, 10);
entity_set_edict(g_bomby[i], EV_ENT_owner, id);
entity_set_model(g_bomby[i], "models/p_hegrenade.mdl");
entity_set_origin(g_bomby[i], LocVec);
}
}
bombs_explode(ent, damage, radius)
{
if (!pev_valid(ent))
return;

new attacker = pev(ent, pev_owner)

new Float:entOrigin[3], Float:fDistance, Float:fDamage, Float:nade_damage, Float:nade_radius, Float:vOrigin[3]
nade_damage = float(damage)
nade_radius = float(radius)
pev(ent, pev_origin, entOrigin)
entOrigin[2] += 1.0

new victim = -1
while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, entOrigin, nade_radius)) != 0)
{
if (attacker==victim || !pev_valid(victim)) continue;

pev(victim, pev_origin, vOrigin)
fDistance = get_distance_f(vOrigin, entOrigin)
fDamage = nade_damage - floatmul(nade_damage, floatdiv(fDistance, nade_radius))
fDamage *= estimate_take_hurt(entOrigin, victim, 0)
if(fDamage>0.0)
{
if(get_user_team(attacker)!=get_user_team(victim))
{
if(pev(victim, pev_health))
ExecuteHam(Ham_TakeDamage, victim, ent, attacker, fDamage, DMG_BULLET)
}
}
}
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord(floatround(entOrigin[0]));
write_coord(floatround(entOrigin[1]));
write_coord(floatround(entOrigin[2]));
write_short(sprite_blast);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
}
stock Float:estimate_take_hurt(Float:fPoint[3], ent, ignored)
{
new Float:fOrigin[3]
new tr
new Float:fFraction
pev(ent, pev_origin, fOrigin)
engfunc(EngFunc_TraceLine, fPoint, fOrigin, DONT_IGNORE_MONSTERS, ignored, tr)
get_tr2(tr, TR_flFraction, fFraction)
if ( fFraction == 1.0 || get_tr2( tr, TR_pHit ) == ent )
return 1.0
return 0.6
}

  • +
  • -
  • 0

#2 Hiroshima

    Godlike

  • Administrator

Reputacja: 1312
Godlike

  • Postów:4968
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Málaga
Offline

Napisano 04.12.2011 11:47

Automatyczna wiadomość


Ten temat został przeniesiony z forum:
Scripting AMXX > Pluginy
do
AMX Mod X > Multilingual


  • +
  • -
  • 0

#3 ^Grzyboo

    Wszechobecny

  • Użytkownik

Reputacja: 239
Wszechwidzący

  • Postów:461
  • Imię:Grzyboo
  • Lokalizacja:Tak
Offline

Napisano 04.12.2011 11:48


public CreateNalot(id)
{
if(!g_use || !is_user_alive(id))
return;
CreatePlane(id)
set_task(1.0, "CreateBombs", id+997, "", 0, "a", 3)
set_task(6.0, "remove_ent")
g_use--;
}



Here you've got.

Just checking if is player alive.
  • +
  • -
  • 0

#4 totoff

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:122
  • Imię:christophe
  • Lokalizacja:france
Offline

Napisano 04.12.2011 12:24

you can put me in my .sma please thank you
  • +
  • -
  • 0

#5 Hiroshima

    Godlike

  • Administrator

Reputacja: 1312
Godlike

  • Postów:4968
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Málaga
Offline

Napisano 04.12.2011 12:48

O.o just used ctrl+c and ctrl+v... is that so hard?

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "KillStreak"
#define VERSION "1.0"
#define AUTHOR "cypis"
new sprite_blast;
new PobraneOrigin[3];
new g_bomby[15]
new g_use
public plugin_init() {
            register_plugin(PLUGIN, VERSION, AUTHOR)

            register_forward(FM_Touch, "fw_Touch");
            register_logevent("RundStart", 2, "1=Round_Start");

            register_clcmd("say /air", "CreateNalot")
}
public plugin_precache()
{
            sprite_blast = precache_model("sprites/dexplo.spr")
            precache_model("models/p_hegrenade.mdl");
            precache_model("models/Mig29.mdl");
            precache_sound("mw/jet_fly1.wav");
}
public RundStart()
{
            client_print(0, print_chat, "Tu as le droit a un bombardement par round, pointe ton viseur ou tu veut lancer le bombardement puis tape /air");
            g_use = 1
}
public fw_Touch(ent, id)
{
            if (!pev_valid(ent))
                            return FMRES_IGNORED

            new EntClassName[32]
            entity_get_string(ent, EV_SZ_classname, EntClassName, charsmax(EntClassName))
            if(equal(EntClassName, "Bomb"))
            {
                            bombs_explode(ent, 100, 150)
                            remove_entity(ent)
                            return FMRES_IGNORED
            }
            return FMRES_IGNORED
} 
public CreateNalot(id)
{
            if(!g_use || !is_user_alive(id))
                            return;
            CreatePlane(id)
            set_task(1.0, "CreateBombs", id+997, "", 0, "a", 3)
            set_task(6.0, "remove_ent")
            g_use--;
}
public remove_ent()
            remove_entity_name("Samolot"); 
public CreatePlane(id){
            new Float:Origin[3], Float: Velocity[3];
            get_user_origin(id, PobraneOrigin, 3);
            entity_get_vector(id, EV_VEC_origin , Origin);
            Origin[2] = Origin[2] + 250;

            new Float: vAngle[3];
            entity_get_vector(id, EV_VEC_v_angle, vAngle);

            vAngle[0] *= -1.0;

            new g_samolot = create_entity("info_target");
            entity_set_string(g_samolot, EV_SZ_classname, "Samolot");
            entity_set_int(g_samolot, EV_INT_solid, 2);
            entity_set_int(g_samolot, EV_INT_movetype, 8);
            entity_set_edict(g_samolot, EV_ENT_owner, id);
            entity_set_model(g_samolot, "models/Mig29.mdl");
            entity_set_origin(g_samolot, Origin);
            entity_set_vector(g_samolot, EV_VEC_angles, vAngle); 
            VelocityByAim(id, 1000 , Velocity);
            Velocity[2] = Origin[2];
            entity_set_vector(g_samolot, EV_VEC_velocity ,Velocity);

            emit_sound(g_samolot, CHAN_ITEM, "mw/jet_fly1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
}
public CreateBombs(taskid)
{         
            new id = (taskid-997)
            new radlocation[3];
            new randomx;
            new randomy;
            PobraneOrigin[2] += 50;

            for(new i=0; i<15; i++)
            {
                            randomx = random_num(-150,150);
                            randomy = random_num(-150,150);

                            radlocation[0] = PobraneOrigin[0]+1*randomx;
                            radlocation[1] = PobraneOrigin[1]+1*randomy;
                            radlocation[2] = PobraneOrigin[2];
                            new Float:LocVec[3];
                            IVecFVec(radlocation, LocVec);

                            g_bomby[i] = create_entity("info_target");
                            entity_set_string(g_bomby[i], EV_SZ_classname, "Bomb");
                            entity_set_int(g_bomby[i], EV_INT_solid, 2);
                            entity_set_int(g_bomby[i], EV_INT_movetype, 10);
                            entity_set_edict(g_bomby[i], EV_ENT_owner, id);
                            entity_set_model(g_bomby[i], "models/p_hegrenade.mdl");
                            entity_set_origin(g_bomby[i], LocVec);
            }
}
bombs_explode(ent, damage, radius)
{
            if (!pev_valid(ent))
                            return;

            new attacker = pev(ent, pev_owner)

            new Float:entOrigin[3], Float:fDistance, Float:fDamage, Float:nade_damage, Float:nade_radius, Float:vOrigin[3]
            nade_damage = float(damage)
            nade_radius = float(radius)
            pev(ent, pev_origin, entOrigin)
            entOrigin[2] += 1.0

            new victim = -1
            while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, entOrigin, nade_radius)) != 0)
            {
                            if (attacker==victim || !pev_valid(victim)) continue;

                            pev(victim, pev_origin, vOrigin)
                            fDistance = get_distance_f(vOrigin, entOrigin)
                            fDamage = nade_damage - floatmul(nade_damage, floatdiv(fDistance, nade_radius))
                            fDamage *= estimate_take_hurt(entOrigin, victim, 0)
                            if(fDamage>0.0)
                            {
                                            if(get_user_team(attacker)!=get_user_team(victim))
                                            {
                                                            if(pev(victim, pev_health))
                                                                            ExecuteHam(Ham_TakeDamage, victim, ent, attacker, fDamage, DMG_BULLET)
                                            }
                            }
            }
            message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
            write_byte(TE_EXPLOSION);
            write_coord(floatround(entOrigin[0]));
            write_coord(floatround(entOrigin[1]));
            write_coord(floatround(entOrigin[2]));
            write_short(sprite_blast);
            write_byte(32);
            write_byte(20);
            write_byte(0);
            message_end();
}
stock Float:estimate_take_hurt(Float:fPoint[3], ent, ignored)
{
            new Float:fOrigin[3]
            new tr
            new Float:fFraction
            pev(ent, pev_origin, fOrigin)
            engfunc(EngFunc_TraceLine, fPoint, fOrigin, DONT_IGNORE_MONSTERS, ignored, tr)
            get_tr2(tr, TR_flFraction, fFraction)
            if ( fFraction == 1.0 || get_tr2( tr, TR_pHit ) == ent )
                            return 1.0
            return 0.6
}

  • +
  • -
  • 0

#6 totoff

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:122
  • Imię:christophe
  • Lokalizacja:france
Offline

Napisano 16.12.2011 22:18

I did not understand sorry.
it is possible to put a timer for example I make / air and another player scores / air 2 seconds later a message apparrait: You must wait 13 seconds to launch the bomber.

It is configured to launch the bomber every 15 seconds

it's possible please?

Nobody want to help me please

someone please?
  • +
  • -
  • 0

#7 totoff

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:122
  • Imię:christophe
  • Lokalizacja:france
Offline

Napisano 02.01.2012 10:59

please
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych