Hello.
That plugin sets targets punch angle and ignites him if attacker uses knife. But have bug: when someone throwing a grenade and changing to a knife, the plugin works like player attacks with knife.
How to solve this bug ?
PHP Code:
if(StrEqual(weapon, "weapon_knife"))
{
new buttons = GetClientButtons(attacker);
if (!(buttons & IN_ATTACK2))
{
new Float:punch[3];
punch[0] = GetRandomFloat(1.0, 15.0);
punch[1] = GetRandomFloat(1.0, 15.0);
punch[2] = GetRandomFloat(1.0, 15.0);
IgniteEntity(victim, kfire_time);
SetEntPropVector(victim, Prop_Send, "m_vecPunchAngle", punch);
}
else if (!(buttons & IN_ATTACK))
{
new Float:punch2[3];
punch2[0] = GetRandomFloat(1.0, 100.0);
punch2[1] = GetRandomFloat(1.0, 100.0);
punch2[2] = GetRandomFloat(1.0, 100.0);
SetEntPropVector(victim, Prop_Send, "m_vecPunchAngle", punch2);
}
}