Hi,
can anyone remove blood (when I hit other parts of the body than HeadShoot it bleeds) from this plugin?
And can anyone make the server (for example, statsx and bullet damage plugins) not count damage from this plugin (except HeadShoot) as damage?
can anyone remove blood (when I hit other parts of the body than HeadShoot it bleeds) from this plugin?
And can anyone make the server (for example, statsx and bullet damage plugins) not count damage from this plugin (except HeadShoot) as damage?
Код:
#include <amxmodx>
#include <reapi>
#define HitHead(%1) (get_member(%1, m_LastHitGroup) == HITGROUP_HEAD)
#define RETURN_CONTINUE HC_CONTINUE
#define RETURN_SUPERCEDE HC_SUPERCEDE
#define SET_RESULT_INTEGER(%1) SetHookChainReturn(ATYPE_INTEGER, %1)
#define PL_VERSION "0.0.2"
#define IsPlayer(%1) (1 <= (%1) <= g_iMaxPlayers)
new g_iMaxPlayers
public plugin_init()
{
register_plugin("[ReAPI] Only HeadShot", PL_VERSION, "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(!IsPlayer(pevAttacker) || !(bitsDamageType & DMG_BULLET))
return RETURN_CONTINUE
if(pevAttacker == pevInflictor && !HitHead(pPlayer) && get_user_weapon(pevAttacker) != CSW_KNIFE)
{
SET_RESULT_INTEGER(false)
return RETURN_SUPERCEDE
}
return RETURN_CONTINUE
}
Вложения
-
1 KB Просмотры: 1