public fw_think(ent)
{
new model[25]; pev(ent, pev_model, model, 24);
if (!equali(model, "models/snowballs/w_snowball.mdl"))
return FMRES_IGNORED;
set_task(1.6, "act_explode", ent);
return FMRES_SUPERCEDE;
}
public act_explode(ent)
{
if (!is_valid_ent(ent)) return;
new attacker = entity_get_edict(ent, EV_ENT_owner);
new Float:fOrigin[3], colors[4];
entity_get_vector(ent, EV_VEC_origin, fOrigin);
if(get_user_team(attacker) == 1)
colors ={ 255, 255, 255, 255}
else if(get_user_team(attacker) == 2)
colors = { 255, 255, 255, 255}
new iOrigin[3];
for(new i=0;i<3;i++) iOrigin[i] = floatround(fOrigin[i]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_BLOODSPRITE);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2] + 30);
write_short(blood);
write_short(blood);
write_byte(colors[2]);
write_byte(40); message_end();
emit_sound(ent, CHAN_AUTO, "weapons/unchill.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
new entlist[33];
new numfound = find_sphere_class(ent, "player", 200.0, entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid)) continue; ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 50.0, 0);
}
remove_entity(ent);
}
Załączone pliki
Użytkownik sweeper edytował ten post 07.12.2012 20:37