SA-MP Forums Archive
Mysql saving accounts. - 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 saving accounts. (/showthread.php?tid=421137)



Mysql saving accounts. - shady001 - 08.03.2013

I'm changing my gamemode to mysql and i was wondering how to do the save of accounts ...

1.Keep the OnPlayerUpdateEx that saves ALL player data when player disconnects ...

or

2.When a value it's changed i update the DB ... this will take me a lot more time .

I want to know which solution is better , i mean which is faster and will not make lag or any things like this.


Re: Mysql saving accounts. - mamorunl - 08.03.2013

That depends on how your script works. If you only have really small updates (like once in 10 minutes you update a value that is saved in the DB) then go with option 2.

If your script alters all the values on a regular basis then use option 1


Re: Mysql saving accounts. - shady001 - 08.03.2013

My GameMode is RolePlay ... and if i would have to update db every time i change a playerdata variable i should do this in like 200-300+ places ... And i want to know id i do the save on player disconnect of all the variables(~ 150 player variables) i was wondering if that would not create lag ... and like how much time will that OnPlayerUpdate take (ms/s)