for loop question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: for loop question (
/showthread.php?tid=427632)
for loop question -
HurtLocker - 02.04.2013
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"?
Re: for loop question -
Konstantinos - 02.04.2013
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.
|
Re: for loop question -
HurtLocker - 02.04.2013
Thanks a lot.