Disconnecting a player
#1

Hey!

I need a function which disconnects the player if he doesn't want to register/login. Kick() or Ban() is not the best way
to do it (but maybe the only way), so I'm trying to do something with the '/q' command, to DC from the client, not from the server.

Can I use the server to send a '/q' command to it from the player's client, and if it's possible, how?
Reply
#2

As far as I know it's not possible...
However if you don't want a "kick/ban" message at OnPlayerDisconnect to be shown you could use a a player param..
e.g. SetPVarInt(playerid, "ForceLeaving", 1);
and at OnPlayerDisconnect:
pawn Код:
case 2:
{
   if(GetPVarInt(playerid, "ForceLeaving") == 1)
   {
       Normal emssage;
   }else{
       kick msg;
   }
   return 1;
}
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
As far as I know it's not possible...
However if you don't want a "kick/ban" message at OnPlayerDisconnect to be shown you could use a a player param..
e.g. SetPVarInt(playerid, "ForceLeaving", 1);
and at OnPlayerDisconnect:
pawn Код:
case 2:
{
   if(GetPVarInt(playerid, "ForceLeaving") == 1)
   {
       Normal emssage;
   }else{
       kick msg;
   }
   return 1;
}
The reason I wanted to do it is to allow player to connect my server, if they change they mind about registration. And if I'm right, after X Kick() the server bans the player.
Reply
#4

Kick(playerid) kicks the player only... he can connect again whenever he wants.. Ban(playerid) bans the player...
Kick would work well for your useage.. I'm using it, too
Reply
#5

Okey, thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)