PDA

View Full Version : OnPlayerUpdate Delay?


Matz
26/10/2012, 08:52 AM
Does anyone know how much ms is that callback?

Abhishek.
26/10/2012, 09:04 AM
what how much is that callback?
you mean how many times is it called? then its called every second while you do a action.or it could be when you chage your state i mean driveing spectating etc... dont know perfectly sorry.

jessejanssen
26/10/2012, 09:05 AM
As far as I know, it gets called at about every second if you're standing still and doing nothing and if you move ( Drive, run, whatever. ) it gets called many more times, not exactly sure how much times though.

Best regards,
Jesse

Matz
26/10/2012, 09:19 AM
Thank you both. Well, for cheap host, seems I have to use timers instead of this.

cessil
26/10/2012, 09:29 AM
how about you show what you are putting in it so others can help you optimize it?

Matz
26/10/2012, 10:00 AM
Actually it is for general things such as glass objects re-create, players' exp bar update, scores, anti cheats etc. but I made a 2000 ms timer for all of them. I think it will reduce CPU usage.

cessil
26/10/2012, 10:12 AM
now sure what you mean by the window thing, exp should be done when the experience changes, anticheat is perfect for OPU, also running everything on a 2000ms timer might be worse if they're all doing the checks in the same function.

there's a profiler plugin that allows you to see what's causing bottlenecks in your script

Matz
26/10/2012, 11:34 AM
Not everyting on same timer but if there are a few timers which running at the same time (like 10 timers) might be bad for CPU that's why I put similar checks in a same timer.

SetTimer("update",2000,1); // expbar, anti-cheats, TAB Score
SetTimer("ping",30000,1); // high ping checker
SetTimer("SendMSG",300000,1); // random msgs
SetTimer("Payday",3600000,1); // payday