Optimizing MAX_PLAYERS?
#9

Quote:
Originally Posted by MattTucker
Посмотреть сообщение
So basically I would be looping with a max number of the gMaxPlayers rather than the MAX_PLAYERS.
Your method won't work as the first slots can be empty due to players leaving, that's what both BloodMaster and I tried to explain by giving an example.

Player 3 and 4 are online. Your loop will go 0 .. 1 .. stop (2 players online only) and basically it will do nothing for those two connected players.

Quote:
Originally Posted by MattTucker
Посмотреть сообщение
I never really looked into the foreach structure, but I do think programming is a place where the sky's the limit. Why should I count on someone's else? (Not taking anything from ******, he's infact, more of an idol for me)
That's a bad way of thinking. There are several includes and plugins that make the way we code easier.

Quote:
Originally Posted by MattTucker
Посмотреть сообщение
[..] and my aim is to get the best possible optimization.
Then go for foreach as everyone has suggested. It is the best method for player-loops.
Reply


Messages In This Thread
Optimizing MAX_PLAYERS? - by MattTucker - 19.12.2016, 18:58
Re: Optimizing MAX_PLAYERS? - by Konstantinos - 19.12.2016, 19:02
Re: Optimizing MAX_PLAYERS? - by BloodMaster - 19.12.2016, 19:02
Re: Optimizing MAX_PLAYERS? - by PrO.GameR - 19.12.2016, 19:04
Re: Optimizing MAX_PLAYERS? - by iLearner - 19.12.2016, 19:06
Re: Optimizing MAX_PLAYERS? - by MattTucker - 19.12.2016, 19:07
Re: Optimizing MAX_PLAYERS? - by oMa37 - 19.12.2016, 19:10
Re: Optimizing MAX_PLAYERS? - by MattTucker - 19.12.2016, 19:14
Re: Optimizing MAX_PLAYERS? - by Konstantinos - 19.12.2016, 19:22
Re: Optimizing MAX_PLAYERS? - by MattTucker - 19.12.2016, 19:26

Forum Jump:


Users browsing this thread: 2 Guest(s)