[CSGO/ANY] Firing an event to a specific client
Posted: Mon Aug 31, 2020 2:11 am
In SourceMod, there's EventManager::FireEventToClient(): I'm not really sure how to accomplish the same in SP. Any help would be greatly appreciated.
Syntax: Select all
void EventManager::FireEventToClient(EventInfo *pInfo, IClient *pClient)
{
// The IClient vtable is +sizeof(void *) from the IGameEventListener2 (CBaseClient) vtable due to multiple inheritance.
IGameEventListener2 *pGameClient = (IGameEventListener2 *)((intptr_t)pClient - sizeof(void *));
pGameClient->FireGameEvent(pInfo->pEvent);
}