Posts: 146
Threads: 8
Joined: Feb 2010
Reputation:
0
What do you think is better? and Why?
I don't know which is better.
Posts: 414
Threads: 8
Joined: Jan 2010
Reputation:
0
If you mean whats the best way to loop through players, foreach no doubt.More efficient-faster.
Posts: 299
Threads: 30
Joined: Nov 2010
Reputation:
0
foreach... because for(the loop) goes over all the players... and foreach goes through the online players
Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
Foreach can be used for other loops too by making your own itterators. (i find it usefull for looping through teams or objects to)
Posts: 179
Threads: 26
Joined: Oct 2009
Reputation:
0
I think this question has been answered a lot of times.
Yes, foreach is better because it only loops through certain IDs added by you with Iter_Add(...)
Iter_Add is not needed for player looping because it's done automatically.
Posts: 146
Threads: 8
Joined: Feb 2010
Reputation:
0
Thanks for your questions, I wasn't sure about this.