Quote:
Originally Posted by el.nino
|
That is not a good example.
Here is how I would do it. (NOT TESTED! It may be needed to add more lines)
PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "fw_takedamage")
}
public fw_takedamage(victim, infilctor, attacker, Float:damage, bits)
{
static Float:origin[3]
entity_get_vector(infilctor, EV_VEC_origin, origin)
if (is_in_viewcone(victim, origin, 1))
{
// HIT FROM FRONT
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
__________________