PHP Code:
HamRadiusDamage(ent, Float:radius, Float:damage, bits)
{
new target = 0, Float:origin[3], Float:o[3], maxplayers = get_maxplayers(), los = g_los, Float:fakeorig[3]
pev(ent, pev_origin, origin)
new owner = pev(ent, pev_owner)
xs_vec_copy(origin, fakeorig)
fakeorig[2] += 2.0
new iOwnerTeam = get_user_team(owner)
while(( target = engfunc(EngFunc_FindEntityInSphere, target, origin, radius) ))
{
if (maxplayers < target)
break
if (!is_user_alive(target))
continue
if (iOwnerTeam == get_user_team(target))
continue
pev(target, pev_origin, o)
if (los && !is_in_los(fakeorig, o))
continue
xs_vec_sub(origin, o, o)
if (xs_vec_len(o) > radius)
continue
Ham_ExecDamageB(target, ent, pev(ent, pev_owner), damage * ((1.0 - (xs_vec_len(o) / radius))*2.0), HIT_GENERIC, bits)
Create_TE_BEAMENTS( ent, target, g_lightningSpr, 0, 15, 10, 20, 15, 255, 0, 0, 255, 0 )
}
}
__________________