OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Luke on 29 Jun 2009, 23:35:10
-
Hey guys, is the following syntax right?
_array=_this select 0;
_script=_this select 1;
{
_crew = crew _x;
{[_y] execvm "_script"} foreach _crew;
} foreach _array;
Thanx, as always.
Luke
-
Inner loops of forEach will safely mask the value of _x from outer loops. Also, where you to pass the name of a script to your function, it would be passed directly to execVM, not passed as part of a string:
{
_crew = crew _x; // _x refers to element of _array
{ [_x] execVM _script } foreach _crew; // _x refers to element of _crew
hint str _x; // _x refers to element of _array
} foreach _array;