SA-MP Forums Archive
Saving 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: Saving system (/showthread.php?tid=335402)



Saving system - Tomer!.$ - 18.04.2012

Well I found out that many servers use enum PlayerInfowhen they set money/weapons/whatever in commands and they convert the enum to dini/SQL or whatever they use on OnPlayerDisconnect. So I wonder why? Why can't you just set the variable directly from the saving system when you build commands and such instead of just saving it on OnPlayerDisconnect?
Will it cause laggs if I'll set the variable directly to my saving system at commands like /pay, /giveweapon and any other command which requires something to be saved?


Re: Saving system - Tomer!.$ - 18.04.2012

By the way I just gave dini and SQL as an examples, it might be INI or whatever you use.


Re: Saving system - SuperViper - 18.04.2012

Yes it will lag and people will be able to exploit this to lag the server by spamming those commands, which will continue executing queries and stop your server from doing any actions until the queries are completed.


Re : Saving system - Tomer!.$ - 18.04.2012

And if let's say, I will just convert the enum variables to my saving system on OnPlayerDisconnect yes it won't lag but on the other hand, in case of server restart/server falldown/reback/whatever it won't save the variables of the saving system, will it?


Re: Saving system - SuperViper - 18.04.2012

No it won't but you can add a command to save the user which could only be used every 5 minutes or so.


Re : Saving system - Tomer!.$ - 18.04.2012

Yeah I actually thought about creating a repetitive timer for saving function like every 10 minutes but it might lag the server if it has a lot of users online, right?


Re : Saving system - Tomer!.$ - 18.04.2012

Well?