04.05.2018, 15:07
I would do that in the following way;
PHP код:
new bool:IsRestarting: // Create a new variable
// Under your command
IsRestarting = true;
// OnPlayerDisconnect
if(!IsRestarting) // We tell the script to only do the following if the server is not restarting
{
new string[128];
switch(reason)
{
case 0:format(string, sizeof(string), "%s timed out.", GetName(playerid));
case 1:format(string, sizeof(string), "%s left.", GetName(playerid));
case 2:format(string, sizeof(string), "%s kicked.", GetName(playerid));
}
SendClientMessageToAll(-1, string);
}
// OnGameModeExit
IsRestarting = false;
// function used:
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}