i wrote this script the other day it may give you some ideas
call getin.sqs
[thislist] exec "getin.sqs" if in an array give the trigger time for the group to be in the trigger
or [man1] exec "getin.sqs" this is for the leader
or [Alpha] exec "getin.sqs" this is for the group
;Script By Michael --- www.zonekiller.ath.cx ---
[email protected]
_grp = _this select 0
_aunits = units _grp
;makes an array of all empty vehicles on the island of these types the 6000 is the distance of the array
~0.1
_objects = nearestObjects [leader _grp, ["jeep","car","air","Tank","Truck","
;ship"], 6000]
_b = 0
_t = 0
_s = count _aunits
; if no empty vehicles exit
count _objects == 0 : goto "exit"
;if unit is in a vehicle goto next unit
#loop
? vehicle (_aunits select _t) != (_aunits select _t) : _t =_t + 1; goto "loop"
~0.1
_truck = _objects select _b
;if no vehicles within 200 mtrs exit
? _truck distance (_aunits select _t) > 200 : exit
~0.1
; check for empty positions
_freecommander = _truck emptyPositions "commander"
_freedriver = _truck emptyPositions "driver"
_freegunner = _truck emptyPositions "gunner"
_com = 0
_driver = 0
_gunner = 0
;if you set this number to 2 it will leave 2 empty spaces in the vehicle. 1 for 1 , 3 for 3
_cargo = 0
_c = units _truck
~0.1
_h = count _c
~0.1
;if vehicle is not empty get next vehicle
; take this line out if you want ai to get into a vehicle that has some units in it
?(_h > 0) : _b = _b + 1 ; goto "loop"
; get into these position if available
~0.2
?(alive (_aunits select _t)) && (_freedriver > _driver) : _driver = 1; (_aunits select _t) AssignAsdriver _truck; _t = _t + 1
~0.2
?(alive (_aunits select _t)) && (_freegunner > _gunner) : _gunner = 1; (_aunits select _t) AssignAsgunner _truck; _t = _t + 1
~0.2
?(alive (_aunits select _t)) && (_freecommander > _com) : _com = 1;(_aunits select _t) AssignAscommander _truck; _t = _t + 1
~0.2
_b = _b + 1
~1
;check how many cargo positions are available
_freecargo = _truck emptyPositions "cargo"
#getin
? vehicle (_aunits select _t) != (_aunits select _t) : _t =_t + 1; goto "getin"
~0.5
?(alive (_aunits select _t)) && (_freecargo > _cargo) : (_aunits select _t) AssignAscargo _truck
~0.1
;when full it will look for next vehicle
?(alive (_aunits select _t)) && (_freecargo <= _cargo) : goto "loop"
_t = _t + 1
_cargo = _cargo + 1
~0.1
?(_t < _s) : goto "getin"
_aunits orderGetIn true
exit
i hope this may give you some ideas
Michael