Jak przerobic bazuke by zaliczała kille jakby zabił z kosy (u góry wizerunek kosy itd.
Lub przynajmnie dawała np. 40 xp za killa z niej bo jak na razie nic nie daje
Spoiler
public DotykRakiety(ent)
{
if ( !is_valid_ent(ent))
return;
new attacker = entity_get_edict(ent, EV_ENT_owner);
new Float:velocity[3];
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast);
write_byte(32); // scale
write_byte(20); // framerate
write_byte(0);// flags
message_end();
new entlist[33];
new numfound = find_sphere_class(ent, "player", 250.0, entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid))
continue;
if(get_user_team(attacker) != get_user_team(pid) || attacker ==pid)
{
ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 70.0, 1);
bf_add_point(attacker,punkty_za_rakiete);
}
entity_get_vector(pid,EV_VEC_velocity,velocity);
velocity[2] = random_float(300.0,500.0);
entity_set_vector(pid,EV_VEC_velocity,velocity);
}
remove_entity(ent);
}
public PostawMine(id)
{
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
new ent = ent_create("Mine",id,MOVETYPE_TOSS,origin,"models/mine.mdl",SOLID_BBOX,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0},0,0,0,40)
drop_to_floor(ent);
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
emit_sound( ent, CHAN_VOICE, "weapons/mine_deploy.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
emit_sound( ent, CHAN_BODY , "weapons/mine_charge.wav", 0.2, ATTN_NORM, 0, PITCH_NORM );
return PLUGIN_CONTINUE;
}
public ent_create(class_name[],owner,moveType,Float:origin[3],model[],solidType,Float:sizeMin[3],Float:sizeMax[3],R,G,B,amount)
{
new ent = create_entity("info_target");
entity_set_string(ent ,EV_SZ_classname, class_name);
entity_set_edict(ent ,EV_ENT_owner, owner);
entity_set_int(ent, EV_INT_movetype, moveType);
entity_set_origin(ent, origin);
entity_set_int(ent, EV_INT_solid, solidType);
entity_set_model(ent, model);
entity_set_size(ent,sizeMin,sizeMax);
set_rendering(ent,kRenderFxNone, R,G,B, kRenderTransTexture,amount) ;
return ent;
}
public PostawBombe(id)
{
new Float:origin[3],Float:Porigin[3];
entity_get_vector(id, EV_VEC_origin, Porigin);
get_user_hitpoint(id,origin)
if(get_distance_f(origin,Porigin) < 100.0)
{
zlom[id] -=25;
new ent = ent_create("Bomba",id,MOVETYPE_BOUNCEMISSILE,origin,"models/dynamite.mdl",SOLID_BBOX,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0},0,0,0,255)
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
emit_sound( ent, CHAN_VOICE, "weapons/mine_deploy.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
emit_sound( ent, CHAN_BODY , "weapons/mine_charge.wav", 0.2, ATTN_NORM, 0, PITCH_NORM );
}
else
{
client_print(id,print_center,"Za Daleko!")
}
return PLUGIN_CONTINUE;
}
{
if ( !is_valid_ent(ent))
return;
new attacker = entity_get_edict(ent, EV_ENT_owner);
new Float:velocity[3];
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast);
write_byte(32); // scale
write_byte(20); // framerate
write_byte(0);// flags
message_end();
new entlist[33];
new numfound = find_sphere_class(ent, "player", 250.0, entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid))
continue;
if(get_user_team(attacker) != get_user_team(pid) || attacker ==pid)
{
ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 70.0, 1);
bf_add_point(attacker,punkty_za_rakiete);
}
entity_get_vector(pid,EV_VEC_velocity,velocity);
velocity[2] = random_float(300.0,500.0);
entity_set_vector(pid,EV_VEC_velocity,velocity);
}
remove_entity(ent);
}
public PostawMine(id)
{
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
new ent = ent_create("Mine",id,MOVETYPE_TOSS,origin,"models/mine.mdl",SOLID_BBOX,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0},0,0,0,40)
drop_to_floor(ent);
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
emit_sound( ent, CHAN_VOICE, "weapons/mine_deploy.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
emit_sound( ent, CHAN_BODY , "weapons/mine_charge.wav", 0.2, ATTN_NORM, 0, PITCH_NORM );
return PLUGIN_CONTINUE;
}
public ent_create(class_name[],owner,moveType,Float:origin[3],model[],solidType,Float:sizeMin[3],Float:sizeMax[3],R,G,B,amount)
{
new ent = create_entity("info_target");
entity_set_string(ent ,EV_SZ_classname, class_name);
entity_set_edict(ent ,EV_ENT_owner, owner);
entity_set_int(ent, EV_INT_movetype, moveType);
entity_set_origin(ent, origin);
entity_set_int(ent, EV_INT_solid, solidType);
entity_set_model(ent, model);
entity_set_size(ent,sizeMin,sizeMax);
set_rendering(ent,kRenderFxNone, R,G,B, kRenderTransTexture,amount) ;
return ent;
}
public PostawBombe(id)
{
new Float:origin[3],Float:Porigin[3];
entity_get_vector(id, EV_VEC_origin, Porigin);
get_user_hitpoint(id,origin)
if(get_distance_f(origin,Porigin) < 100.0)
{
zlom[id] -=25;
new ent = ent_create("Bomba",id,MOVETYPE_BOUNCEMISSILE,origin,"models/dynamite.mdl",SOLID_BBOX,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0},0,0,0,255)
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
emit_sound( ent, CHAN_VOICE, "weapons/mine_deploy.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
emit_sound( ent, CHAN_BODY , "weapons/mine_charge.wav", 0.2, ATTN_NORM, 0, PITCH_NORM );
}
else
{
client_print(id,print_center,"Za Daleko!")
}
return PLUGIN_CONTINUE;
}
Spoiler
public StworzRakiete(id)
{
if (is_user_alive(id))
{
ilosc_rakiet_gracza[id]--;
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
entity_get_vector(id, EV_VEC_v_angle, vAngle);
new iOrigin[3];
get_user_origin(id,iOrigin,1)
IVecFVec(iOrigin,Origin)
new Ent = create_entity("info_target");
entity_set_string(Ent, EV_SZ_classname, "Rocket");
entity_set_model(Ent, "models/rpgrocket.mdl");
vAngle[0] *= -1.0;
entity_set_origin(Ent, Origin);
entity_set_vector(Ent, EV_VEC_angles, vAngle);
entity_set_int(Ent, EV_INT_effects, 2);
entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
entity_set_edict(Ent, EV_ENT_owner, id);
VelocityByAim(id, 1100 , Velocity);
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
emit_sound(Ent, CHAN_WEAPON, "weapons/rocketfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
set_pev(Ent, pev_nextthink, get_gametime() + SMOKETRAIL_RATE)
set_task(0.6,"reload_baz",id+65666)
}
return PLUGIN_CONTINUE;
}
public reload_baz(id){
id -= 65666;
set_animation(id,2)
}
{
if (is_user_alive(id))
{
ilosc_rakiet_gracza[id]--;
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
entity_get_vector(id, EV_VEC_v_angle, vAngle);
new iOrigin[3];
get_user_origin(id,iOrigin,1)
IVecFVec(iOrigin,Origin)
new Ent = create_entity("info_target");
entity_set_string(Ent, EV_SZ_classname, "Rocket");
entity_set_model(Ent, "models/rpgrocket.mdl");
vAngle[0] *= -1.0;
entity_set_origin(Ent, Origin);
entity_set_vector(Ent, EV_VEC_angles, vAngle);
entity_set_int(Ent, EV_INT_effects, 2);
entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
entity_set_edict(Ent, EV_ENT_owner, id);
VelocityByAim(id, 1100 , Velocity);
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
emit_sound(Ent, CHAN_WEAPON, "weapons/rocketfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
set_pev(Ent, pev_nextthink, get_gametime() + SMOKETRAIL_RATE)
set_task(0.6,"reload_baz",id+65666)
}
return PLUGIN_CONTINUE;
}
public reload_baz(id){
id -= 65666;
set_animation(id,2)
}