!LOOP!
#1

foreach(new i : Player) or foreach(Player, i) or for(new or 0.3.7 PoolSize AND WHY?
Reply
#2

foreach(new i : Player) - optimalization of code.
Reply
#3

Okay. Can you tell me something about other loops?

i.e for(new + IsPlayerConnected and PoolSize + IsPlayerConnected
Reply
#4

No answers?
Reply
#5

pawn Code:
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
{
    if(!IsPlayerConnected(i))
    {
        continue;
    }

    // Do something with the player here.
}
Reply
#6

PoolSize is better then foreach?
Reply
#7

So?..
Reply
#8

Use what you want, they are pretty much the same.
Reply
#9

Okay, thank you so much.
Reply
#10

Looping through the players with for(new is better if your server is constantly full.

Other than that, I'd go with foreach(new i : Player)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)