For Loop or Foreach?
#1

What do you think is better? and Why?
I don't know which is better.
Reply
#2

If you mean whats the best way to loop through players, foreach no doubt.More efficient-faster.
Reply
#3

foreach... because for(the loop) goes over all the players... and foreach goes through the online players
Reply
#4

Foreach can be used for other loops too by making your own itterators. (i find it usefull for looping through teams or objects to)
Reply
#5

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.
Reply
#6

Thanks for your questions, I wasn't sure about this.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)