12.03.2013, 15:09
I've been through this over and over again, can't seem to make it work. I have a command for admins to restart the server while in-game and it executes the RCON command "gmx" - it restarts fine, but when the player spawns it goes to the 0.0 position with skin ID 0 and continuously dies but all of the other stats were loaded. I'm not sure if it's a bug for 0.3x or if there's another way of doing it since it worked the last time I coded the same thing.
I hope someone could resolve or help me with this. Below is what I have coded. Thanks!
GMX command:
OnGMX():
OnServerRestart():
I hope someone could resolve or help me with this. Below is what I have coded. Thanks!
GMX command:
pawn Код:
command(gmrestart, playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(Player[playerid][pAdmin] >= 5)
{
OnGMX();
}
}
return 1;
}
pawn Код:
public OnGMX()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
OnPlayerSave(i);
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...", 20000, 5);
SetTimer("OnServerRestart", 10000, 0);
return 1;
}
pawn Код:
public OnServerRestart()
{
SendRconCommand("gmx");
return 1;
}