[HELP] How to Create "Server 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: [HELP] How to Create "Server Restart Command" ? (
/showthread.php?tid=587133)
[HELP] How to Create "Server Restart Command" ? -
Gaswoman - 28.08.2015
How to create command for server restart, help me, pls


Re: [HELP] How to Create "Server Restart Command" ? -
anassmaroc - 28.08.2015
Код:
CMD:gmx(playerid, params[])
{
OnGameModeExit();
return 1;
}
Re: [HELP] How to Create "Server Restart Command" ? -
SoFahim - 28.08.2015
Use
PHP код:
CMD:gmx(platerid, params[])
//you can use if(IsPlayerAdmin(playerid)) here
{
SendRconCommand("gmx");
return 1;
}
Quote:
Originally Posted by anassmaroc
Код:
CMD:gmx(playerid, params[])
{
OnGameModeExit();
return 1;
}
|
Sometime it not work. If there nothing in OnGameModeExit , the server will not restart or can crash the server
Re: [HELP] How to Create "Server Restart Command" ? -
J0sh... - 28.08.2015
Quote:
Originally Posted by anassmaroc
Код:
CMD:gmx(playerid, params[])
{
OnGameModeExit();
return 1;
}
|
That would just call whats inside:
PHP код:
public OnGameModeExit() {
printf("I'm exiting");
return 1;
}
Then it would just print I'm exiting nothing else.
@OP Read @SoFahim's answer.
Re: [HELP] How to Create "Server Restart Command" ? -
Vince - 28.08.2015
The irony is that there's an actual native for that:
https://sampwiki.blast.hk/wiki/GameModeExit
Re: [HELP] How to Create "Server Restart Command" ? -
xVIP3Rx - 28.08.2015
Quote:
Originally Posted by Vince
|
Wait does that restart or just exits ?, or exit and loads the next, if none then load the same one ?
And what differs this from "gmx" ?