Hi,
So, i was trying to kick a client after connecting if they were not able to join the server, but the server keeps crashing when i am trying to cast the msg to the IClient interface.
I already read the sourcemod source code, and i am pretty sure that's how it is doing the job, but i am missing something that i cant figure it out.
I import the class CPlayer from the source code, and i am calling the method Initialize on the event OnClientConnected , thats where is crashing the server.
Code:
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(playerid));
IPlayerInfo *playerinfo = playerinfomanager->GetPlayerInfo(pEdict);
if (pNetChan != NULL && playerinfo->IsConnected())
{
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
}