06.03.2013, 02:16
I'm just wondering, is OnPlayerDisconnect used or called whenever SendRconCommand("gmx"); is sent? Because whenever I use my "/gmx" command, it would restart the server although it doesn't save the players' stats and when they spawn - they just die and have the CJ skin as default.
Here's my code:
Here's my code:
pawn Код:
command(gmx, playerid, params[])
{
if(IsConnected(playerid))
{
if(Player[playerid][pAdmin] >= 5)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SavePlayer(i);
TogglePlayerSpectating(i, true);
DisablePlayerCheckpoint(i);
SetPlayerInterior(i, 0);
SetPlayerVirtualWorld(i, 0);
SetPlayerCameraPos(i, 1460.0, -1324.0, 287.2);
SetPlayerCameraLookAt(i, 1374.5, -1291.1, 239.0);
}
}
GameTextForAll("~w~Server Restarting...", 10000, 5);
SetTimer("ServerRestart", 5000, 0);
}
}
return 1;
}
public ServerRestart()
{
SendRconCommand("gmx");
return 1;
}