how to use foreach
#2

You write:
Код:
foreach(new i : Player)
{
    //Code
}
Instead of:
Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        //Code
    }
}
Also if you want to loop all existing vehicles you use Vehicle instead of Player.
That's all you need to know.
Reply


Messages In This Thread
how to use foreach - by ChrisPa - 11.11.2018, 16:18
Re: how to use foreach - by lollypap54 - 11.11.2018, 17:44

Forum Jump:


Users browsing this thread: 2 Guest(s)