;Thanks to Sefe for major help with this script :o)
_PopUpUnits = [sniper1, sniper2, sniper3, sniper4, sniper5, sniper6]
_UnitCoordinates = [10357.09,12685.92,0.05], [10352.26,12695.23,0.05], [10352.42,12679.24,0.05], [10356.93,12689.01,0.05], [10354.49,12682.38,0.05], [10354.50,12692.35,0.05]
#Loop
? (Count _PopUpUnits) == 0 : goto "Skip"
_UnitNumber = Random (Count _PopUpUnits)
? _UnitNumber >= (Count _PopUpUnits) : _UnitNumber = (Count _PopUpUnits) - 1
_CurrentUnit = _PopUpUnits Select _UnitNumber
_CurrentCoordinates = _UnitCoordinates Select _UnitNumber
_CurrentUnit setpos (getpos _CurrentCoordinates)
~(1 + (Random 3))
if (not (Alive _CurrentUnit)) then {Hint "You have killed a target"; _PopUpUnits = _PopUpUnits - [_CurrentUnit]; _UnitCoordinates = _UnitCoordinates - [_CurrentCoordinates]}
_Currentunit setpos (getpos gamelogic1)
~(1 + (Random 5))
Goto "Loop"
#Skip
Hint "You have killed the last target"
k, thats what i have at the moment...
now it causes error zero divisor on this line:
_CurrentCoordinates = _UnitCoordinates Select _UnitNumber
im really gratefull for the help so far sefe - just need this last bit sorted. Thaaaaanx.