Name each unit like you did it already
;init.sqs
units_array = []
"if alive _x then {units_array = units_array + [_x]" forEach [u1,u2,u3,u4,r1,r2,r3,r4]
What it does?
It initializes an array (units_array) and then puts each alive unit of given units
inside the brackets into the array.
At the end units_array would look like this: [u1,u2,u3,u4,r1,r2,r3,r4]
if all of these units were choosen and/or enabled.
If one of the units doesn't exist, it will not be inside
units_array.
whatever you want to with the units later, you can do it - forEach units_array
@tommi
When opening this thread i would have expected a similar anwer of you, especially because
i spent one and a half week of showing you this method (remember the init.sqs of your money script problem).
:edit - btw - there's another variant, using the same technique but executing the script straight without putting
them into an array;
"if alive _x then {[_x] exec {script.sqs}}" forEach [u1,u2,u3,u4,r1,r2,r3,r4]
~S~ CD