SA-MP Forums Archive
Fixing my MySQL Save system - 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: Fixing my MySQL Save system (/showthread.php?tid=497678)



Fixing my MySQL Save system - Mriss - 28.02.2014

coudl someone read through my script and fix my s ave system? when I make someone admin ingame and they log out it doesnt save etc, also with everything but account password and username lawl
Script
Pastebin


Re: Fixing my MySQL Save system - Knekt - 28.02.2014

You're setting everything to 0 on disconnect, could be something =P
Set that to 0 when unregistered players connect, if registered players you just load their stats and it will set the values accordingly.

I dont feel like editing as I myself isn't very sure about this without doing some trial'n'error
pawn Код:
PlayerInfo[playerid][pAdmin] = 0;
        PlayerInfo[playerid][pVip] = 0;
        PlayerInfo[playerid][pScore] = 0;
        PlayerInfo[playerid][pTrusted] = 0;
        PlayerInfo[playerid][pHighest] = 0;
        PlayerInfo[playerid][pMoney] = 0;
Quote:
Originally Posted by Vince
Посмотреть сообщение
You're not setting the IsPlayerLoggedIn variable when the log in, only when they register. This once more proves the importance of debugging. If you'd debug your OnPlayerDisconnect you would've noticed that the value of the variable was 0.
^Proper advice


Re: Fixing my MySQL Save system - Vince - 28.02.2014

You're not setting the IsPlayerLoggedIn variable when the log in, only when they register. This once more proves the importance of debugging. If you'd debug your OnPlayerDisconnect you would've noticed that the value of the variable was 0.


Re: Fixing my MySQL Save system - Mriss - 28.02.2014

Could you fix it?