SA-MP Forums Archive
/disconnect and /reconnect? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /disconnect and /reconnect? (/showthread.php?tid=100233)



/disconnect and /reconnect? - Jake Canfield - 03.10.2009

Hi its me jake again.

I was just wondering if it was possible to make a command such as...

/reconnect = will disconnect and then go back to where you first join and it says connecting to.
/disconnect = will disconnect and just show... Server closed the connection.


Re: /disconnect and /reconnect? - MadeMan - 03.10.2009

/disconnect is possible but I don't think /reconnect is


Re: /disconnect and /reconnect? - Hot - 03.10.2009

At Disconnect you could Kick the player, and at Reconnect the maximum you can do is kill the player and force selection class. :/


Re: /disconnect and /reconnect? - iLinx - 03.10.2009

/disconnect =
Код:
kick(playerid);
reconnect isnt possible if your not connected to the server.


Re: /disconnect and /reconnect? - Jake Canfield - 03.10.2009

I know the /kick

but i am asking if you do /disconnect it will show
You have been disconnected from the server.
Server closed the connection.
Then if player is still in game after 10 seconds it will close the game.

Is that possible?


Re: /disconnect and /reconnect? - MadeMan - 03.10.2009

Basic /disconnect command:

pawn Код:
//under OnPlayerCommandText

if(strcmp(cmdtext, "/disconnect", true) == 0)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have been disconnected from the server.");
    Kick(playerid);
    return 1;
}
But shutting players game through script isn't possible.


Re: /disconnect and /reconnect? - member - 03.10.2009

Quote:
Originally Posted by Jake Canfield
I know the /kick

but i am asking if you do /disconnect it will show
You have been disconnected from the server.
Server closed the connection.
Then if player is still in game after 10 seconds it will close the game.

Is that possible?
That isn't possible if you kick the player (meaning you actually disconnect them). If you disconnect them, how is the server gonna be able to communicate with the player? Once you disconnect, the link between server and player is cut off, you cant magically re-connect them back. Otherwise so many servers would make people automatically connect to their servers (lol, that' d be hilarious) without even the player wanting to play there. What you can probably do is fake disconnect the player (like send the player a message like "Server closed the connection.", then when they type /reconnect do something?

EDIT:
Quote:
Originally Posted by MadeMan
But shutting players game through script isn't possible.
Well, you can kinda do that, by making the player crash. look at some /f****up command i think these do the job. Not sure though.


Re: /disconnect and /reconnect? - Jake Canfield - 03.10.2009

Quote:
Originally Posted by MadeMan
Basic /disconnect command:

pawn Код:
//under OnPlayerCommandText

if(strcmp(cmdtext, "/disconnect", true) == 0)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have been disconnected from the server.");
    Kick(playerid);
    return 1;
}
But shutting players game through script isn't possible.
Can you make that in a filterscript for me?


Re: /disconnect and /reconnect? - MadeMan - 03.10.2009

Quote:
Originally Posted by Jake Canfield
Can you make that in a filterscript for me?
Just put it into your script under OnPlayerCommandText.


Re: /disconnect and /reconnect? - Sergei - 03.10.2009

The only way of closing player's game is to crash the client.