Raised This Month: $51 Target: $400
 12% 

IClient


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

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

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



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 17:13.


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