02.08.2011, 17:10
Make a custom restart command. GMX tends to lead to bugs. Here's an example of mine:
May wish to create an administrator check in there somewhere.
pawn Код:
CMD:restart(playerid, params[])
{
#pragma unused params
#pragma unused playerid
new
uFile[50],
player_Name[MAX_PLAYER_NAME];
foreach(Player, i)
{
GetPlayerName(i, player_Name, sizeof(player_Name));
format(uFile, 50, USER_DIRECTORY, player_Name);
new
INI:playerFile = INI_Open(uFile);
INI_WriteInt(playerFile, "AuthLvl", SInfo[i][AuthLvl]);
INI_WriteInt(playerFile, "VIP", SInfo[i][VIP]);
INI_WriteInt(playerFile, "Cash", GetPlayerMoney(i));
INI_WriteInt(playerFile, "Score", GetPlayerScore(i));
INI_WriteInt(playerFile, "Kills", SInfo[i][Kills]);
INI_WriteInt(playerFile, "Skin", SInfo[i][CustomSkin]);
INI_WriteInt(playerFile, "Deaths", SInfo[i][Deaths]);
INI_WriteInt(playerFile, "CustomCarID", SInfo[i][CustomCarID]);
INI_WriteInt(playerFile, "CustomCarC1", SInfo[i][CustomCarC1]);
INI_WriteInt(playerFile, "CustomCarC2", SInfo[i][CustomCarC2]);
INI_WriteString(playerFile, "CustomCarPlate", SInfo[i][CustomCarPlate]);
printf("<User: System> Saved ID %d", i);
INI_Close(playerFile);
}
GameModeExit();
return 1;
}