Posts: 449
Threads: 48
Joined: Jan 2010
Reputation:
0
Hey everyone, I am curious about this one little question: Is it better to make a Timer, which will calculate your speed and update the string, or add this code under the OnPlayerUpdate ? In this way, I will need no timer. Will this improve the performance, or not? Because, its more accurate than the timer.
Posts: 2,220
Threads: 154
Joined: Jul 2009
Reputation:
0
I think a timer would be fine. OnPlayerUpdate is called for everything you do, not only a vehicle update - run a 1-second timer instead.
Posts: 2,364
Threads: 135
Joined: Dec 2009
Reputation:
0
i got mine under OnPlayerUpdate becouse if there were 500 players and i run a 1 seconds TimerEx for all of these players there would be increase in CPU and lag.
as under OnPlayerUpdate will not cause the same problem becouse is allredy being called !
Posts: 173
Threads: 19
Joined: Dec 2009
Reputation:
0
i will use function with global timer... onplayerupdate is the fastes, but isnt so good for souch things, use OnPlayerUpdate only for AntiCheat or something similarly...
Posts: 449
Threads: 48
Joined: Jan 2010
Reputation:
0
Hmm... Okay, thank you for your answers! I'll try to figure something out.
Posts: 836
Threads: 107
Joined: Sep 2010
Reputation:
0
Also there are ton loads of Speedometers on the forum, just take a look at a simple one, or tow.