SA-MP Forums Archive
Problems with MySQL data saving - 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: Problems with MySQL data saving (/showthread.php?tid=250226)



Problems with MySQL data saving - sobolanux - 22.04.2011

Hello. I have a problem with saving player data on a MySQL based system when I use the 'gmx' command. If I set it to save everything when you type the gmx command and I have the autosave at OnPlayerDisconnect too it will just set all the data in the MySQL table to '0'. If I remove what it`s scripted at OnPlayerDisconnect it will save correctly, but I won`t be able to save the data if a player exits normally or it gets kicked/crash. If I only leave the script at OnPlayerDisconnect it will still reset the data.

So, the only way I can actually do it, without losing the script at OnPlayerDisconnect (which is absolutely neccesarry) it`s to take each player, save the data, kick the player and when all the players are handled to restart the gamemode. This way it won`t reset the data, but it`s quite too much trouble for the players, if you have to do many restarts. So, any other idea??