02.08.2011, 12:34
Quote:
I'm not sure because i just refix the script on 1 friend :/ If you wanna i can share all of the script here?
|
You can make a seperate command though:
pawn Код:
//somewhere outside any function:
forward CloseServer();
public CloseServer() { return SendRconCommand("exit"); }
//In OnPlayerCommandText, if you use dcmd/zcmd, just modify it a little bit.
if (strcmp("/exitserver", cmdtext, true, 11) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Error: RCON only command.");
GameTextForAll("~g~AUTO-SAVING STATS!~n~~r~Server will shutdown in 10 seconds.", 10000, 3);
SetTimer("CloseServer", 10100, false);
for ( new i=0; i<MAX_PLAYERS; i++ )
{
if( IsPlayerConnected(i) && !IsPlayerNPC(i) ) { SavePlayer(i); }
}
return true;
}