Hello, I was wondering if it is possible to let the monster draw blood from only the front players!
Look at the example below to understand a little of what I'm talking about
:
Code:
public set_attack(ent)
{
new owner = entity_get_edict(ent, EV_ENT_owner)
new victim = get_victim(ent)
new Float:start[3], Float:end[3], Float:flFraction, pHit
entity_get_vector(ent, EV_VEC_origin, start)
entity_get_vector(victim, EV_VEC_origin, end)
engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, ent, 0)
get_tr2(0, TR_flFraction, flFraction)
pHit = get_tr2(0, TR_pHit)
if (flFraction < 1.0) if (is_valid_ent(pHit)) set_damage(pHit, owner, npc_damage)
}
Sorry for the language mistranslated