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

Solved Hooking IServerTools finctions leads to compile-time errors


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 01-04-2020 , 10:20   Hooking IServerTools finctions leads to compile-time errors
Reply With Quote #1

I'm trying to hook SetKeyValue functions from IServerTools:

PHP Code:
    virtual bool SetKeyValueCBaseEntity *pEntity, const char *szField, const char *szValue ) = 0;
    
virtual bool SetKeyValueCBaseEntity *pEntity, const char *szFieldfloat flValue ) = 0;
    
virtual bool SetKeyValueCBaseEntity *pEntity, const char *szField, const Vector &vecValue ) = 0
If I hook only the first one, it goes fine, but for the second and third I get errors:
error: redefinition of '__SourceHook_FHCls_IServerToolsSetKeyValue0'
Though the functions are not the same and have different parameters.
What is the proper way to define them?

Here my corrent definitions:
PHP Code:
SH_DECL_HOOK3(IServerToolsSetKeyValueSH_NOATTRIB0boolvoid *, const char *, const char *  );
SH_DECL_HOOK3(IServerToolsSetKeyValueSH_NOATTRIB0boolvoid *, const char *, float  );
SH_DECL_HOOK3(IServerToolsSetKeyValueSH_NOATTRIB0boolvoid *, const char *, const Vector &  ); 

Last edited by kadet.89; 01-14-2020 at 08:41.
kadet.89 is offline
Send a message via Skype™ to kadet.89
 



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 03:16.


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