View Single Post
Author Message
client21
Senior Member
Join Date: Apr 2013
Old 06-04-2018 , 02:17   SourceHook compile errors
Reply With Quote #1

PHP Code:
class TEST : public SDKExtension
{
public:
    
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismmchar *errorsize_t maxlengthbool late);
    
void Hook_ClientActive(edict_t *pEntitybool bLoadGame);
};

IServerGameClients *gameclients NULL;

TEST g_Test;
SMEXT_LINK(&g_Test);

bool TEST::SDK_OnMetamodLoad(ISmmAPI *ismmchar *errorsize_t maxlengthbool late)
{
    
// Error    2    error C2065: 'id' : undeclared identifier
    
PLUGIN_SAVEVARS();

    
// Error    3    error C2065: 'maxlen' : undeclared identifier
    
GET_V_IFACE_ANY(GetServerFactorygameclientsIServerGameClientsINTERFACEVERSION_SERVERGAMECLIENTS);
    
    
// Error    4    error C3861: '__SourceHook_FHAddIServerGameClientsClientActive': identifier not found
    
SH_ADD_HOOK(IServerGameClientsClientActivegameclientsSH_MEMBER(this, &TEST::Hook_ClientActive), true);
    
    return 
true;
}

void TEST::Hook_ClientActive(edict_t *pEntitybool bLoadGame)
{
    
g_pSM->LogError(myself"Hook_ClientActive(%d, %d)"gamehelpers->IndexOfEdict(pEntity), bLoadGame);

Why?
client21 is offline