Convert "for" to "foreach"
#2

What is RunData[sRun][Runners][sP] ?


You can make a foreach loop with a player variable. For example, if Runners are those players who's participate to event make a variable like :
HTML Code:
new OnEvent[MAX_PLAYERS];
When the players enter in event, put
HTML Code:
OnEvent[playerid] = 1;
then, make your loop:

HTML Code:
foreach(Player, i)
{
        if(OnEvent[i] == 1)
       {
	TogglePlayerControllable(i, 1);
       }
}
Reply


Messages In This Thread
Convert "for" to "foreach" - by AaronJ - 16.06.2016, 09:09
Re: Convert "for" to "foreach" - by Nin9r - 16.06.2016, 10:09
Re: Convert "for" to "foreach" - by AaronJ - 16.06.2016, 11:01
Re: Convert "for" to "foreach" - by Nin9r - 16.06.2016, 11:08
Re: Convert "for" to "foreach" - by AaronJ - 16.06.2016, 11:48
Re: Convert "for" to "foreach" - by PrO.GameR - 16.06.2016, 17:10
Re: Convert "for" to "foreach" - by AaronJ - 16.06.2016, 18:50
Re: Convert "for" to "foreach" - by biker122 - 16.06.2016, 18:50

Forum Jump:


Users browsing this thread: 1 Guest(s)