Restart command - 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)
+--- Thread: Restart command (
/showthread.php?tid=329686)
Restart command -
Jermi - 29.03.2012
Hello, i need to add a restart command to restart my server IG
Re: Restart command -
mineralo - 29.03.2012
pawn Код:
if(strcmp(cmd, "/gmx", true) == 0)
{
GameModeExit();
return 1;
}
Re: Restart command -
doreto - 29.03.2012
or why you dont restart your servar wich rcon command.[HOW TO] login into your servar then type /rconlogin and your password (example:/rconlogin 123) after you login as rcon admin type /rcon gmx and servar will automatic restart !
EDIT: you can use all rcon cmd over
here
Re: Restart command -
mineralo - 29.03.2012
Quote:
Originally Posted by doreto
mineralo this will not restart servar it will only stop him!!!
|
are you sure?

I use it myself, and works, when server get gamemodeexit the server will restart, I'm sure at 100500% you can check yourself
Re: Restart command -
Jermi - 29.03.2012
@Detro thanks
@Mineralo i think is not
Re: Restart command -
doreto - 29.03.2012
loops you have right for that im sorry

XD
Re: Restart command -
Shabi RoxX - 29.03.2012
you can also use
pawn Код:
SendRconCommand("gmx");//use this in you command
Re: Restart command -
nickdodd25 - 29.03.2012
Heres one so only rcon admins can restart the gamemode so you dont have random people restarting it on you....
pawn Код:
if (strcmp("/restart", cmdtext, true, 8) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"Only admins can use this command");
SendRconCommand("gmx");
/*or if you have some type of auto restart like if the server would shut down on its own you could do this
SendRconCommand("exit"); That will make the server do a compleate restart not just the gamemode. But only that if you have a auto crash restart thing*/
return 1;
}
But like i said only use exit if you have any sort of auto restart or your server will just shut off