Raised This Month: $209 Target: $400


Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Junior Member
Join Date: Jun 2013
Old 10-03-2019 , 07:58   IClient
Reply With Quote #1


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.

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());

Last edited by Contf; 10-03-2019 at 08:04.
Contf is offline

Thread Tools
Display Modes

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 07:45.

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