Posts: 2,175
Threads: 235
Joined: Sep 2009
Reputation:
0
why you have to do with a loop if OnplayerUopdate callback return already playerid?
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
He probably meant to say is it better to use a timer with a loop or OPU. It totally depends what you're doing!
In any case, you should use foreach.
Posts: 1,177
Threads: 27
Joined: Sep 2011
Reputation:
0
It causes more general resource usage, not RAM specifically. Think about this:
OnPlayerUpdate is called approximately 33 times per second. You loop through 500 players and perform an action for each one. If the code inside of your loop takes even 1 milasecond, it will equal 500 milaseconds total and your server will freeze because it's performing 500 milasecond code every 30 milaseconds PER PLAYER.
Posts: 1,534
Threads: 129
Joined: Jan 2012
Reputation:
0
Ahh.. Thank you. So, the second one is better than the first one.