for loop question
#1

I want to use this loop :for(new i=0; i<MAX_PLAYERS; i++) but i want to make X loops where X is the connected players number and not the MAX_PLAYERS value, but not with this format:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
if (IsPlayerConnected(i))
{

}
My question is, is there any format to enter instead of "MAX_PLAYERS"?
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=92679

Quote:

Note that this IS NOT a simple definition to insert the normal loop, it's actually a completely different implementation using lists of players, making it faster that the normal system. Furthermore, because of the way it works, it doesn't matter what MAX_PLAYERS is, whether it's correct for your server or not, this loop will always take the same amount of time as it ONLY loops through connected players, not unconnected players.

Reply
#3

Thanks a lot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)