31.12.2015, 20:23
It's most likely because you haven't checked whether the player has actually authenticated and spawned before saving their stats, which causes the data saved under their name to be wiped, as no variables have been set.
Example:
(under your login dialog)
PlayerData[playerid][pLoaded] = true;
(under your data save callback)
if(!PlayerData[playerid][pLoaded])
return 0;
Reset the pLoaded variable once they connect / disconnect.
Example:
(under your login dialog)
PlayerData[playerid][pLoaded] = true;
(under your data save callback)
if(!PlayerData[playerid][pLoaded])
return 0;
Reset the pLoaded variable once they connect / disconnect.