Convert "for" to "foreach"
#1

Hi all!

I have an array with the user IDs, with a function a must toggle all the players in this array to "controllable" with "TogglePlayerControllable"

I'm not able to convert the following for loop to a foreach loop using the standalone foreach or the y_less/iterate.

RunData[sRun][RunnersCount] is an integer
RunData[sRun][Runners] is an array

Code:
for(new sP = 1; sP <= RunData[sRun][RunnersCount]; sP++)
{
	TogglePlayerControllable(RunData[sRun][Runners][sP], 1);
}
Can someone help me?

Regards
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)