Ive got a group of units, each one is called pg0, pg1, pg2 etc etc. Each unit has;
[this]exec "scriptname.sqs" in their init.
_unit = _this select 0
#start
@ !alive _unit
~5
removeallweapons _unit
?_unit == pg0 :goto "pg0"
?_unit == pg1 :goto "pg1"
?_unit == pg2 :goto "pg2"
?_unit == pg3 :goto "pg3"
?_unit == pg4 :goto "pg4"
?_unit == pg5 :goto "pg5"
?_unit == pg6 :goto "pg6"
?_unit == pg7 :goto "pg7"
?_unit == pg8 :goto "pg8"
?_unit == pg9 :goto "pg9"
hint "premature exit"
exit
{etc etc}[/size]
However, the script suffers from a bad case of premature exitation. While I expected
_unit = _this select 0
would return the units name (eg. pg0 ) it instead returns its group designation (eg. WEST Alpha black 3). Since the script doesnt check the variable _unit agasint WEST Alpha black 3, the script runs right through and exits. Ive spent the last hour or two on this, and cant seem to get it working right. Has anyone got any ideas?