Maybe this is enough :
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#tryinclude <cstrike_pdatas>
#if !defined _cbaseentity_included
#assert Cstrike Pdatas and Offsets library required! Read the below instructions: \
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101 \
2. Put it into amxmodx/scripting/include/ folder \
3. Compile this plugin locally, details: wiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29 \
4. Install compiled plugin, details: wiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing
#endif
#define VERSION "0.0.6"
new g_iMaxPlayers;
#define IsPlayer(%0) ( 1 <= (%0) <= g_iMaxPlayers )
public plugin_init()
{
register_plugin("Migraine", VERSION, "ConnorMcLeod");
RegisterHam(Ham_TakeDamage, "player", "OnCBasePlayer_TakeDamage_P", true);
g_iMaxPlayers = get_maxplayers();
}
// int CBasePlayer :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
public OnCBasePlayer_TakeDamage_P( id, iInflictor, iAttacker, Float:flDamage, bitsDamageType ) // return int
{
if( id != iAttacker && IsPlayer(iAttacker) && iAttacker && iInflictor && get_user_weapon(iAttacker) == CSW_KNIFE && pev(id, pev_dmg_take) )
{
new iAttackerWeapon = get_pdata_cbase(iAttacker, m_pActiveItem);
if( iAttackerWeapon > 0 && get_pdata_float(iAttackerWeapon, m_flNextSecondaryAttack, XO_CBASEPLAYERWEAPON) == 1.1 )
{
set_pev(id, pev_punchangle, Float:{180.0, 0.0, 0.0});
}
}
}
__________________