SA-MP Forums Archive
MySQL wiping account - 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)
+--- Thread: MySQL wiping account (/showthread.php?tid=597412)



MySQL wiping account - izeatfishz - 31.12.2015

Sometimes if a player logs in, and freezes on the login screen and has to ctrl+alt+del and quit before they fully login, their account will be fully reset. I fetch the players login details where their name = the name in my database but unsure why it's doing this


Re: MySQL wiping account - Stanford - 31.12.2015

Maybe if you provide the specific lines of the query we might be able to help you better!


Re: MySQL wiping account - Abagail - 31.12.2015

You may have something that deletes players account's if they haven't logged in(this may be meant for registration backouts or something?)


Re: MySQL wiping account - yvoms - 31.12.2015

Its most likely because the player exits the game before the account is saved.
Try saving the account under certain functions.


Respuesta: MySQL wiping account - IzadorO - 31.12.2015

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.