Saving problems.
#1

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;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)