View Single Post
Author Message
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 10-29-2016 , 08:52   Get weapon index
Reply With Quote #1

Hello. Trying to declare CBaseCombatWeapon::ReloadOrSwitchWeapons(CBas eCombatWeapon *this), but forward return nothing.I mean does not work at all. IDA show g_pEntityList for this function, and i guess that need declare in code too for properly work? Anyway, my code is:

PHP Code:
DETOUR_DECL_MEMBER0(Weapon_Switch_or_Reloadvoid)
{
    
    
int weapon_index gamehelpers->EntityToBCompatRef(reinterpret_cast<CBaseCombatWeapon *>(this));     cell_t result Pl_Continue;
    
g_pWeaponSwitch_or_Reload->PushCell(weapon_index);
    
g_pWeaponSwitch_or_Reload->Execute(&result);

    if(
result == Pl_Continue)
    {
        
DETOUR_MEMBER_CALL(Weapon_Switch_or_Reload)();
    }

    return;

Thanks in advance

Last edited by keygens; 10-29-2016 at 08:53.
keygens is offline