Raised This Month: $209 Target: $400
 52% 

How to declare function?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 09-18-2016 , 18:08   How to declare function?
Reply With Quote #1

Hey guys. Learning step by step extensions "as is", and trying to write something by self.
In IDA i found function and i want make forward for it.
But i'm stuck with "CBaseEntity". How to declare it? "void" declared with this:
PHP Code:
int index gamehelpers->EntityToBCompatRef(reinterpret_cast<CBaseCSGrenade *>(this)); 
But how to declare "CBaseEntity *"? Can someone show me how it should be see in code with DETOUR_DECL_MEMBER? Thanks in advance.

Last edited by keygens; 11-06-2016 at 05:10.
keygens is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-18-2016 , 18:13   Re: How to declare BounceTouch?
Reply With Quote #2

depending on what you want to do, there is potentially 2 ways:

1) Include the header file that declares CBaseEntity
2) Declare it as an opaque class.
__________________

Last edited by WildCard65; 09-18-2016 at 18:13.
WildCard65 is offline
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 09-18-2016 , 18:17   Re: How to declare BounceTouch?
Reply With Quote #3

Quote:
Originally Posted by WildCard65 View Post
depending on what you want to do, there is potentially 2 ways:

1) Include the header file that declares CBaseEntity
2) Declare it as an opaque class.

Can you show an example of way number two? Code:
PHP Code:
DETOUR_DECL_MEMBER0(BounceTouchCBaseEntity *)
{

    
cell_t result Pl_Continue;
    
g_pGrenadeBounceTouch->Execute(&result);

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

    return;


Last edited by keygens; 09-18-2016 at 18:17.
keygens is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-18-2016 , 18:18   Re: How to declare BounceTouch?
Reply With Quote #4

Quote:
Originally Posted by keygens View Post
Can you show an example of way number two? Code:
PHP Code:
DETOUR_DECL_MEMBER0(BounceTouchCBaseEntity *)
{

    
cell_t result Pl_Continue;
    
g_pGrenadeBounceTouch->Execute(&result);

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

    return;

PHP Code:
class CBaseEntity;

DETOUR_DECL_MEMBER0(BounceTouchCBaseEntity *)
{

    
cell_t result Pl_Continue;
    
g_pGrenadeBounceTouch->Execute(&result);

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

    return;

__________________
WildCard65 is offline
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 09-18-2016 , 18:40   Re: How to declare BounceTouch?
Reply With Quote #5

Thanks.Solved

Last edited by keygens; 09-18-2016 at 22:56.
keygens is offline
Reply


Thread Tools
Display Modes

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 19:39.


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