OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: WizzyWig on 09 Mar 2003, 22:46:18
-
right im makeing a multiplayer ctf mission in need to know if it posible to make a unit that woz a human player but disconected and is now AI mount a random aircraft (the one close to him) and then fly to a marker on map and Guard area. Im gessing that this will have to be a scripted action but i cant make it work can any one on hear help with my problem
-
Well you could use the nearestObject command to grab the aircraft closest to the unit, but it will only work for vehicles in a 50m perimeter. I guess it'd be much simpler to make a list of all aircraft available, i.e.
_aircraft= [aircraft1,aircraft2,...];
then loop through the list and see which one is closest to _unit:
_minseed=9999
; Initialize with any unit just to make sure OFP allocates variable globally,
; not just within the loop's scope
_daOne=player
"if (_x distance _unit<_minseed) then {_minseed=_x distance _unit;_daOne=_x}" foreach _aircraft
Now _daOne should be the closest aircraft.
-
can u send a demo mission
my email is
swafusa2@hotmail.com or just upload it on hear