Saving players stats on changes or in timer? [MySQL]

Started by SA:MP, May 05, 2023, 08:51 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

SA:MP

Saving players stats on changes or in timer? [MySQL]

Hi guys,



I want to start an discussion about saving player stats.What you think,is better to save player stats immediately(When there is any change in player stats) or in timer(For example every 10 minutes to save all player stats).



1) Save accounts in timer


Code:

UPDATE `users` SET `column1` = '%i',`column2` = '%i', `column3` = '%i', `column4` = '%i',`column5` = '%i' WHERE `ID`='%i'

2) Save column on which we have changes..


Code:

UPDATE `users` SET `column1` = '%i' WHERE `ID`='%i'

UPDATE `users` SET `column2` = '%i' WHERE `ID`='%i'

UPDATE `users` SET `column3` = '%i' WHERE `ID`='%i'

UPDATE `users` SET `column4` = '%i' WHERE `ID`='%i'

UPDATE `users` SET `column5` = '%i' WHERE `ID`='%i'

Now I'm use both option :/ .Half of player stats I save in timer(for example money which changes more often) and half I save on changes(Which changes rarely;for example Level which changes very rarely).

I have Roleplay mode.



What you use? (Sorry for my bad english)

Source: Saving players stats on changes or in timer? [MySQL]