Raised This Month: $51 Target: $400
 12% 

Get weapon index


Post New Thread Reply   
 
Thread Tools Display Modes
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
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 10-30-2016 , 16:16   Re: Get weapon index
Reply With Quote #2

In other words, i can't correctly detour this function. Can someone help me with that with example code? How to declare CBaseCombatWeapon?

Last edited by keygens; 10-30-2016 at 16:17.
keygens is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode