explodeNade(const grenade) {
new Float:origin[3];
get_entvar(grenade, var_origin, origin);
-- UTIL_BeamCylinder(origin, SpriteCylinder, 1, 5, 30, 1, {10, 255, 40}, 255, 5, HEAL_RADIUS);
-- UTIL_CreateExplosion(origin, 65.0, SpriteExplode, 30, 20, (TE_EXPLFLAG_NOSOUND | TE_EXPLFLAG_NOPARTICLES));
-- UTIL_SpriteTrail(origin, SpriteShape);
rh_emit_sound2(grenade, 0, CHAN_WEAPON, "weapons/reapi_healthnade/heal.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
new id = get_entvar(grenade, var_owner);
new team = get_member(id, m_iTeam);
for (new player = 1, Float:playerOrigin[3]; player <= MaxClients; player++) {
if (!is_user_alive(player) || get_member(player, m_iTeam) != team) {
continue;
}
get_entvar(player, var_origin, playerOrigin);
if (get_distance_f(origin, playerOrigin) < HEAL_RADIUS) {
ExecuteHamB(Ham_TakeHealth, player, HEAL_AMOUNT_THROW, DMG_GENERIC);
UTIL_ScreenFade(player);
}
}
destroyNade(grenade);
}