Finally I made it to find them in the radius with this:
Code:
new ent = -1
while((ent = find_ent_by_class(ent, "func_wall")))
{
new Float:fldist, Float:florigin[3]
pev(ent, pev_takedamage, takedamage)
if( takedamage > DAMAGE_NO && pev(ent, pev_flags) & FL_MONSTER )
{
pev(ent, pev_origin, florigin)
fldist = get_distance_f(florigin, fl_vExplodeAt)
if (fldist <= dmgradius && fm_is_ent_visible(pToucher, ent, 0))
{
dRatio = floatdiv(fldist,float(dmgradius))
damage = maxdamage - floatround(floatmul(float(maxdamage),dRatio))
//...do damage
server_print("Monster hit")
}
}
}
EDIT:
Made the damage to work also.
I can't find "can_see_fm" anywhere so I used "fm_is_ent_visible".
Quote:
|
Originally Posted by Nextra
fm_is_ent_visible will return false negatives relatively often (at least there are many common situations where it will due to the origin comparison).
|
And yes, it does. Any other suggestions?