Defining MAX_PLAYERS
#7

Quote:
Originally Posted by Eyce
Посмотреть сообщение
So if there are 50/100 online, foreach would only go through 0 to 50?
That's the point of foreach (hence the name). But not only that simple, if there are 50 players connected, but there were 100 before, the connected IDs are not 0-50, but 50 IDs between 0 and 99, foreach will skip the empty slots and only call for the connected IDs.

A simple for loop will call all between 0 and 99 and you have to see which is connected or not.
Reply


Messages In This Thread
Defining MAX_PLAYERS - by Eyce - 15.04.2016, 13:48
Re: Defining MAX_PLAYERS - by yugecin - 15.04.2016, 13:55
Re: Defining MAX_PLAYERS - by Eyce - 15.04.2016, 14:05
Re: Defining MAX_PLAYERS - by Vince - 15.04.2016, 14:47
Re: Defining MAX_PLAYERS - by yugecin - 15.04.2016, 15:15
Re: Defining MAX_PLAYERS - by Eyce - 15.04.2016, 17:01
Re: Defining MAX_PLAYERS - by NaS - 15.04.2016, 17:07
Re: Defining MAX_PLAYERS - by AbyssMorgan - 15.04.2016, 18:05
Re: Defining MAX_PLAYERS - by Konstantinos - 15.04.2016, 18:11
Re: Defining MAX_PLAYERS - by AmigaBlizzard - 15.04.2016, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)