SA-MP Forums Archive
How to close server? - 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: How to close server? (/showthread.php?tid=131326)



How to close server? - Mauka4 - 02.03.2010

Hey,
I was searching in the forum but didnt know exactly what to look for. I want an in game command that turns off the server similar to /gmx but that the server doesnt turn back on. Its like crashing it. Maybe you know what I mean.


Re: How to close server? - -Rebel Son- - 02.03.2010

GameModeExit is the Function your looking for,


Код:
if(!strmcp(cmdtext,"/nameit",true)) {
GameModeExit();
return 0;
}



Re: How to close server? - aircombat - 02.03.2010

Код:
if(strcmp("/closeserver", cmdtext, true, 10) == 0) {
if(IsPlayerAdmin(playerid)) {
SendRconCommand("exit");
return 1;
}
}
that will make when an rcon admin type /closeserver it close the server

Note : tested and its working
________
Fix Ps3


Re: How to close server? - Correlli - 02.03.2010

Quote:
Originally Posted by [AC
Etch ]
Код:
if(strcmp("/closeserver", cmdtext, true, 10) == 0)
/closeserver has 12 characters, not 10.


Re: How to close server? - aircombat - 02.03.2010

that doesnt matter i tryed the command like that and it worked normally
________
SUZUKI ESTEEM


Re: How to close server? - Miguel - 02.03.2010

Because it reads the first 10 characters.
pawn Код:
if(strcmp("/closeserver", cmdtext, true) == 0) // better



Re: How to close server? - Correlli - 02.03.2010

Quote:
Originally Posted by [AC
Etch ]
that doesnt matter i tryed the command like that and it worked normally
Indeed it does, you should read this.


Re: How to close server? - Scenario - 02.03.2010

Wow. I just made something similar.