Posts: 175
Threads: 44
Joined: Oct 2015
Reputation:
0
This is just a small and stupid question, I wanted to know if i save stats under "OnPlayerUpdate" using my savestats stock, will it cause any lag or something?
Posts: 1,192
Threads: 10
Joined: Dec 2017
Reputation:
0
At most, OnPlayerUpdate is getting called many many times a second i highly recommend saving stats in 2 cases:
1- The moment they change.
2- Using a 3 minute timer.
Posts: 175
Threads: 44
Joined: Oct 2015
Reputation:
0
So if i put SetTimer("SaveStats", 600000, true); under OnGamemodeinit and put my savestats stock under public callback, it will save stats without lagging?
Posts: 244
Threads: 4
Joined: Apr 2010
Reputation:
0
Depends on the size of your stocks. I would recommend to save stats as soon as the player lost the connection (example goes: /q - ESC+exit game - alt+f4 - timeout - crash)
Posts: 244
Threads: 4
Joined: Apr 2010
Reputation:
0
desynced player stats will be safe (never got problems since 2011).
Okay Yes if the Server crashes the players stats wont save, but this also counts for the last 2:59 minutes. the only way to solve this is to got a stable Server and (just for the case) to save the most important stuff as soon as changed.
Posts: 175
Threads: 44
Joined: Oct 2015
Reputation:
0
I've added the timer, It's working perfect. Thanks for the help. Oh and I use Y_INI