Hi Chaps,
I want to determine if an entire squad is in a vehicle before continuing. I know I can loop through an array of units and check the 'x in y' status.
Given the script below, what happens if units 0, 1 & 2 AREN'T in the vehicle but unit 3 IS? The last time (x in y) is checked 'loaded' will be set to true and the script will exit - even though everybody isn't in the vehicle. Is there a better way to do this?
On a related topic, using foreach how do you get goto statements to work?, do you need to 'escape' the "'s? Know what I mean? like this line:-
"?(_x In VehicleName):goto \"MainLoop\"" for each (Units group SquadUnitLeader)
I hope somebody understands my ramblings.
//SCRIPTSTART
SquadUnitLeader = this select 0
VehicleName = this select 1
#MainLoop
"?(_x In VehicleName):loaded=true" foreach (Units group SquadUnitLeader)
?(loaded=false):goto "MainLoop"
exit
//SCRIPTEND