Saving problems. - 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: Saving problems. (
/showthread.php?tid=249657)
Saving problems. -
w84m3 - 19.04.2011
Hi! I have a problem with saving... I am using Fini and I tried Y_ini, Dini and I still have same bug...
So, sometimes everything works fine it saves and loads player data, but sometimes it just doesn't load anything, player just lost everything that he had... All skills, money and stuff... Mostly people lost their items after server restart. And I am using this inventory system on my server
https://sampforum.blast.hk/showthread.php?tid=130436 . What is the problem?? Please help!!
There is a peace of script.
Quote:
forward SavePlayerData(playerid);
public SavePlayerData(playerid)
{
if(!IsPlayerNPC(playerid) && IsPlayerConnected(playerid))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format( PlayerFile , sizeof PlayerFile, SERVER_USER_FILE, name );
new Float:coo[3];
GetPlayerPos(playerid, coo[0], coo[1], coo[2]);
Fini_OpenFile(PlayerFile);
Fini_SetFloat("X", coo[0]);
Fini_SetFloat("Y", coo[1]);
Fini_SetFloat("Z", coo[2]);
Fini_SetVal("Interior", GetPlayerInterior(playerid));
Fini_SetVal("Health", PlayerHealth(playerid));
Fini_SaveFile();
Fini_CloseFile();
}
return 1;
}
|