Server Restart
#3

You can use SSCANF then try this:
Код:
COMMAND:restart(playerid, params[])
{
		new time,string[128];
	    if(!sscanf(params, "i", time)) return SendClientMessage(playerid, -1, "Usage: /restart [time]");  
	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/restart", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 5
		if (APlayerData[playerid][PlayerLevel] >= 5)
		{
			// Let everyone know that the server will be restarted in 2 minutes
			format(string,sizeof(string),"Server restart in %i minutes!",time);
			GameTextForAll(string, 5000, 3);
			SendClientMessageToAll(0xA0A0A0, "Server restart in 2 minutes!");
			// Start the next timer which warns the players again that server will be restarted in 1 minute
			SetTimer("Timer_Restart_WarnPlayers", time, false);
		}
		else
		    return 0;
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Reply


Messages In This Thread
Server Restart - by Trucker[UK] - 26.08.2011, 17:06
Re: Server Restart - by HotPlayer - 26.08.2011, 17:34
Re: Server Restart - by Gagi_Corleone - 26.08.2011, 17:34
Re: Server Restart - by Wyu - 26.08.2011, 17:37
Re: Server Restart - by Kaperstone - 26.08.2011, 17:43
Re: Server Restart - by Trucker[UK] - 26.08.2011, 17:47
Re: Server Restart - by MP2 - 26.08.2011, 17:51

Forum Jump:


Users browsing this thread: 1 Guest(s)