|Description:||Creates an empty vehicle / object of a given type at a given position.|
The vehicle is placed at the nearest possible position to the one specified, to prevent colliding with existing objects. Even if there are no other objects in the way, the created position may not be completely accurate, and would have to be reset, using setPos, if accuracy is crucial.
|Syntax:||type createVehicle position|
|Syntax:||createVehicle [type, position, markers, placement, special, local, asl, noClip, symbol, forcePos, doNotRecord]|
_jeep = "LandRover" createVehicle (position player)
_heli = "AH1W" createVehicle (getMarkerPos "hspawn")
_veh = createVehicle ["A10", position player, , 0, "FLY"]
_veh = createVehicle ["A10", position player, , 0, "FLY", true, true, false, "", false, true] // object is not recorded in the AAR
_veh = createVehicle ["A10", position player, , 0, "FLY", true, true, false, "", false, false] // object is recorded in the AAR
|See also:||createVehicleLocal, createUnit, createMine, deleteVehicle, fn vbs createVehicle|
- Posted on February 22, 2012 - 11:48
- Planes started in the air will have an initial speed that seems to be the average between their maxspeed and landingSpeed, and will be pointed north.
If the plane is initially set to a different direction, it will lose all its momentum, and most likely crash to the ground. To circumvent this, it has to be given an initial setVelocity in the appropriate direction:
_plane = createVehicle ["A10", getPos player,,0,"FLY"]; _pilot = (group player) createUnit [typeOf player, getPos player, , 0, "NONE"]; _pilot moveInDriver _plane; _dir = 90; _plane setDir _dir; _speed = (getNumber (configFile>>"cfgvehicles">>"a10">>"maxspeed") + getNumber (configFile>>"cfgvehicles">>"a10">>"landingSpeed")) / 2; _plane setVelocity [sin _dir*(_speed/3.6), cos _dir*(_speed/3.6), 0];
- Posted on December 13, 2006 - 12:27
- Observe that buildings with the default destrType will not work correctly in multiplayer, when created with this command. The Destruction effect will only be displayed where the building is local.