[Tutorial] GetMaxPlayers() > MAX_PLAYERS ?
#17

Quote:
Originally Posted by Claude
Посмотреть сообщение
MAX_PLAYERS is slower than GetMaxPlayers() if you are NOT talking about full servers
- MAX_PLAYERS defines to 500 players
- GetMaxPlayers() defines to the row of "slots" in "server.cfg" / not sure
NOOTT MAN

so it will not make as many checks on the function GetMaxPlayers


GetMaxPlayers = Function
MAX_PLAYERS = Macro


GetMaxPlayer is slower
If it is required to use GetMaxPlayer use the following:

for (new i = 0 , j = GetMaxPlayers () , i <j; i++)

But MAX_PLAYERS is further optimized.

make sure the player is online and the not is bot
so:
pawn Код:
#Define LoopPlayers (%0,%1) for(new 0%=0,%0 <%1,%0++) if(IsPlayerConnected (%0) && !IsPlayerNPC (%0))
OR USE FOREACH

Tutorial little wrong
Reply


Messages In This Thread
GetMaxPlayers() > MAX_PLAYERS ? - by Desert - 30.09.2010, 07:34
Re: GetMaxPlayers() > MAX_PLAYERS ? - by willsuckformoney - 30.09.2010, 07:36
Re: GetMaxPlayers() > MAX_PLAYERS ? - by [HiC]TheKiller - 30.09.2010, 07:40
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Desert - 30.09.2010, 07:44
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Slice - 30.09.2010, 08:22
Re: GetMaxPlayers() > MAX_PLAYERS ? - by [XST]O_x - 30.09.2010, 09:23
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Slice - 30.09.2010, 09:25
Re: GetMaxPlayers() > MAX_PLAYERS ? - by [XST]O_x - 30.09.2010, 09:29
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Slice - 30.09.2010, 09:30
Re: GetMaxPlayers() > MAX_PLAYERS ? - by LarzI - 30.09.2010, 09:46
Re: GetMaxPlayers() > MAX_PLAYERS ? - by legodude - 30.09.2010, 10:01
Re: GetMaxPlayers() > MAX_PLAYERS ? - by [XST]O_x - 30.09.2010, 10:10
Re: GetMaxPlayers() > MAX_PLAYERS ? - by wups - 30.09.2010, 14:34
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Claude - 30.09.2010, 15:06
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Calgon - 30.09.2010, 15:09
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Kyosaur - 30.09.2010, 15:23
Re: GetMaxPlayers() > MAX_PLAYERS ? - by ipsBruno - 01.10.2010, 17:01
Re: GetMaxPlayers() > MAX_PLAYERS ? - by The_Moddler - 01.10.2010, 17:15
Re: GetMaxPlayers() > MAX_PLAYERS ? - by LarzI - 01.10.2010, 17:44
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Claude - 01.10.2010, 18:21
Re: GetMaxPlayers() > MAX_PLAYERS ? - by LarzI - 01.10.2010, 19:31
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Calgon - 01.10.2010, 20:15
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Claude - 02.10.2010, 13:38
Re: GetMaxPlayers() > MAX_PLAYERS ? - by The_Moddler - 03.10.2010, 09:06
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Calgon - 03.10.2010, 09:26
Re: GetMaxPlayers() > MAX_PLAYERS ? - by LarzI - 03.10.2010, 10:41
Re: GetMaxPlayers() > MAX_PLAYERS ? - by ZecKo - 03.10.2010, 11:22
Re: GetMaxPlayers() > MAX_PLAYERS ? - by Mike_Peterson - 03.10.2010, 12:12
Re: GetMaxPlayers() > MAX_PLAYERS ? - by ZecKo - 03.10.2010, 12:28
Re: GetMaxPlayers() > MAX_PLAYERS ? - by MrDeath537 - 06.01.2011, 22:51
Re: GetMaxPlayers() > MAX_PLAYERS ? - by aco_SRBIJA - 22.03.2012, 10:12

Forum Jump:


Users browsing this thread: 5 Guest(s)