Thread: Migraine
View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-03-2013 , 02:20   Re: Migraine
Reply With Quote #53

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 locallydetailswiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29   \
                
4. Install compiled plugindetailswiki.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_PidiInflictoriAttackerFloat:flDamagebitsDamageType // return int
{
    if( 
id != iAttacker && IsPlayer(iAttacker) && iAttacker && iInflictor && get_user_weapon(iAttacker) == CSW_KNIFE && pev(idpev_dmg_take) )
    {
        new 
iAttackerWeapon get_pdata_cbase(iAttackerm_pActiveItem);
        if( 
iAttackerWeapon && get_pdata_float(iAttackerWeaponm_flNextSecondaryAttackXO_CBASEPLAYERWEAPON) == 1.1 )
        {
            
set_pev(idpev_punchangleFloat:{180.00.00.0});
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-03-2013 at 02:21.
ConnorMcLeod is offline