11.10.2011, 07:39
So, I can't get a proper 'GMX' working. When I GMX and log back in, my HP is 0 and my position is Blueberry Achers, underground by like 2 meters? However if I just log off and back in then it works fine so it's not my actual saving code.
Here's what I have:
Here's what I have:
pawn Код:
YCMD:gmx(playerid, params[])
{
if(gPlayerLoggedIn[playerid] == 0) return 1;
if(PlayerInfo[playerid][Admin] >= 5)
{
new string[126];
format(string, sizeof(string), "Warning: %s has set the server to GMX in 10 seconds...", PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
SetTimer("AdminGMX", 10000, false);
}
return 1;
}
pawn Код:
public AdminGMX()
{
foreach(Player, i)
{
if(gPlayerLoggedIn[i] == 1)
{
SavePlayer(i);
gPlayerLoggedIn[i] = 0;
}
}
GameModeExit();
}
pawn Код:
public OnGameModeExit()
{
foreach(Player, i)
{
if(gPlayerLoggedIn[i] == 1)
{
SavePlayer(i);
gPlayerLoggedIn[i] = 0;
}
}
return 1;
}