PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "HamBurger_TakeDamage");
}
public HamBurger_TakeDamage(victim)
{
new Float:ConfusedAngle[3];
for(new i;i < 3;i++ )
ConfusedAngle[i] = random_float(0.0, 2000.0);
entity_set_vector(victim, EV_VEC_punchangle, ConfusedAngle );
}
I suspect 2000 will be so powerful that in a knife fight the first player to stab the other will kill him so change it to be a random number from x.0 to y.0
Take note that Ham_TakeDamage has 5 parameters but I only need 1 at the moment. If you wish to get the attacker and damage, do this:
PHP Code:
public HamBurger_TakeDamage(victim, inflictor, attacker, Float:damage)