PHP:
#include <amxmodx>
#include <reapi>
new g_iMaxPlayers
public plugin_init()
{
register_plugin("ReAPI HS", "1", "Vaqtincha")
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage", .post = false)
g_iMaxPlayers = get_maxplayers()
}
public CBasePlayer_TakeDamage(const pPlayer, const pevInflictor, const pevAttacker, const Float:flDamage, const bitsDamageType)
{
if((1 <= (pevAttacker) <= g_iMaxPlayers) || !(bitsDamageType & DMG_BULLET))
return HC_CONTINUE
if(pevAttacker == pevInflictor && (get_member(pPlayer, m_LastHitGroup) == HITGROUP_HEAD) && get_user_weapon(pevAttacker) != CSW_KNIFE)
{
SetHookChainReturn(ATYPE_INTEGER, false)
return HC_SUPERCEDE
}
return HC_CONTINUE
}