Code:
#include <amxmodx>
#include <hamsandwich>
new g_iMaxPlayers;
public plugin_init(){
RegisterHam(Ham_TakeDamage, "player", "Function");
g_iMaxPlayers = get_maxplayers();
}
public Function(id, inflictor, attacker, Float:damage, damagebits){
if ( !(1 <= attacker <= g_iMaxPlayers) || !(1 <= id <= g_iMaxPlayers) || !is_user_alive(id) )
return HAM_IGNORED;
new weapon = get_user_weapon(attacker, _, _);
if (weapon == CSW_KNIFE )
{
SetHamParamFloat(4, damage * 2); //Here knife does double damage, ofc you can set it to 0.0 or anything.
return HAM_HANDLED;
}
return HAM_IGNORED;
}
Edit: Original isn't mine.