SA-MP Forums Archive
how to code an /shutdown 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: how to code an /shutdown command (/showthread.php?tid=427753)



how to code an /shutdown command - matthew1211 - 03.04.2013

how do i code an /shutdown command to restart my server what locks user accounts etc so they dont lose their money etc


Re: how to code an /shutdown command - Ryan_Obeles - 03.04.2013

restart or shutdown?? u know they are different....
CMD:gmx(playerid, params[])
{
if(PlayerData[playerid][pAdmin] <= 5)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SavePlayerData(i);
}
SendClientMessageToAll(X11_DARK_RED, "An Admin commenced a server RESTART.");
SendRconCommand("gmx");
}
else
{
SendClientMessage(playerid, X11_RED, "You are not an admin level 5");
}
return 1;
}

if you want it shutdown do SendRconCommand("exit");