i want to hook the Event_Killed function, but i can't get it to work
here is my code:
Code:
HDEFVFUNC(Event_Killed, void, (CBaseEntity* pCBPlayer, const CTakeDamageInfo &info));
...
void VFUNC New_Event_Killed(CBaseEntity* pCBPlayer, const CTakeDamageInfo &info)
{
}
...
void CServerPlugin::ClientActive( edict_t *pEntity )
{
CBasePlayer *pCBPlayer = (CBasePlayer*)CBaseEntity::Instance(pEntity);
if(pCBPlayer)
{
if (!Q_strcmp(pCBPlayer->GetClassname(), "player"))
{
HOOKVFUNC(pCBPlayer, 0, pCBPlayer->Event_Killed, New_Event_Killed);
}
}
}
i use the Virtual function table hook mechanism from
http://forums.alliedmods.net/showthr...?t=37161#15248
it get these errors (translated):
Code:
error C2039: 'Event_KilledRaw_Org': Is not an element of 'CBasePlayer'
error C2039: 'Event_KilledGate': Is not an element of 'CBasePlayer'
error C2228: The left part of '.Build' have to be a class/struct/union
can someone help me?
sry 4 all my stupid questions, but i want to lern it