Owned Cars Disappear on GMX - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Owned Cars Disappear on GMX (
/showthread.php?tid=273644)
Owned Cars Disappear on GMX -
-CaRRoT - 02.08.2011
Well , I Made a Dealership in my Script - It is working fine and everything , but in GMX you lose your owned car , how to stop that ?
Re: Owned Cars Disappear on GMX -
Skylar Paul - 02.08.2011
Make a custom restart command. GMX tends to lead to bugs. Here's an example of mine:
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;
}
May wish to create an administrator check in there somewhere.
Re: Owned Cars Disappear on GMX -
-CaRRoT - 02.08.2011
only that way ? and if i make it like this - i wll have it to save all the other things in the new CMD ?
Re: Owned Cars Disappear on GMX -
Skylar Paul - 02.08.2011
Quote:
Originally Posted by Breto
only that way ? and if i make it like this - i wll have it to save all the other things in the new CMD ?
|
There's probably another way, but this is the easiest in my opinion, and yes, you'd have to say it again. Like you did in OnPlayerDisconnect, or your timer to save accounts if you have one.