Loosing a Variable
#5

pawn Код:
for(new i=0; i <= GetPlayerPoolSize(); i++)
{
    if(IsPlayerConnected(i) && inevent[i] == 1)
        {
            // code
            break;
        }
}
If you use foreach, then replace your loop.


Quote:
Originally Posted by SKAzini
Посмотреть сообщение
snip
I want to point out that using INVALID_PLAYER_ID instead of -1 will make the code much more organized and readable.

Also, there's no need to count the player amount, atleast that's not how I would do it.
Reply


Messages In This Thread
Loosing a Variable - by Rodri99 - 25.08.2015, 16:53
Re: Loosing a Variable - by SpikY_ - 25.08.2015, 17:01
Re: Loosing a Variable - by Rodri99 - 25.08.2015, 17:04
Re: Loosing a Variable - by SKAzini - 25.08.2015, 17:06
Re: Loosing a Variable - by Tamer - 25.08.2015, 17:06
Re: Loosing a Variable - by SKAzini - 25.08.2015, 17:12
Re: Loosing a Variable - by Tamer - 25.08.2015, 17:15
Re: Loosing a Variable - by Rodri99 - 25.08.2015, 17:21

Forum Jump:


Users browsing this thread: 1 Guest(s)