OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Serial Killer on 02 Oct 2005, 19:48:02

Title: Need help with createUnit command
Post by: Serial Killer on 02 Oct 2005, 19:48:02
How do I create a civilian plane to certain marker position and make it to fly at certain height at start?
Title: Re:Need help with createUnit command
Post by: Tyger on 02 Oct 2005, 22:40:13
Code: [Select]
_myHeight = _this select 0
_plane = "Plane" createVehicle getMarkerPos "Mkr_Plane"
_plane setPos [getPos _plane select 0,getPos _plane select 1,(getPos _plane select 2) + _myHeight]

_man = "Man" createUnit [getMarkerPos "Mkr_Plane",groupMan,"man1=this; this moveInDriver _plane",0.5"PRIVATE"]
_man doMove getPos myLogic

That should work. Make that as a script and execute the script as such:
Code: [Select]
[HeightPlaneIsToFlyIn] exec "scriptname.sqs"
Title: Re:Need help with createUnit command
Post by: Serial Killer on 03 Oct 2005, 13:56:51
Thanks!!