Code:
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA)
{
if(is_user_alive(victim))
{
if((attacker != victim)) //prevents killing self with knife from fall damage.
{
if(wpnindex == CSW_KNIFE && TA != 1)
{
if(damage != DMG_FALL)
{
if (pev(attacker,pev_button) & IN_ATTACK2)
{
knifekill = 1
if(hitplace == HIT_HEAD)
{
make_deathmsg(attacker, victim, 1, "knife")
}
else
{
make_deathmsg(attacker, victim, 0, "knife")
}
user_silentkill(victim)
set_user_frags(attacker, get_user_frags(attacker)+1)
}
}
}
}
}
return PLUGIN_HANDLED
}