OnPlayerUpdate
#7

If you're certain every query works, you can skip saving everything again during OnPlayerDisconnect.

Whenever a variable changes, like money, save it in the database with a small query, preferably inside a small function that updates the money on the server, as well as sending a small query to change the money value in the database (like I showed previously using Player_Reward in the other thread).

If you have such a system for everything, you don't need another huge query to save everything when a player logs out, as all data has been saved already when he was playing the game.
Because after the last save, data didn't change anymore, so no reason to save it again.

Whenever I add a new query to my script, I run the server, open Navicat and display the data in my tables.
When I run the game and I edit the value of that new variable (say jailtime), I put myself in jail and check the database, when the game is still running.
If it updates everytime, it works and you can skip saving that when you logout as it has been updated properly.
Reply


Messages In This Thread
OnPlayerUpdate - by vassilis - 15.01.2015, 22:54
Re: OnPlayerUpdate - by DobbysGamertag - 15.01.2015, 22:56
Re: OnPlayerUpdate - by Vince - 15.01.2015, 23:00
Re: OnPlayerUpdate - by Abagail - 15.01.2015, 23:01
Re: OnPlayerUpdate - by vassilis - 15.01.2015, 23:17
Re: OnPlayerUpdate - by vassilis - 16.01.2015, 13:06
Re: OnPlayerUpdate - by PowerPC603 - 16.01.2015, 13:45
Re: OnPlayerUpdate - by De4dpOol - 16.01.2015, 13:45
Re: OnPlayerUpdate - by vassilis - 16.01.2015, 13:51
Re: OnPlayerUpdate - by codectile - 16.01.2015, 13:58

Forum Jump:


Users browsing this thread: 1 Guest(s)