Arma 3 Scripting

Command in Object Manipulation

createVehicleLocal

Also available as Markdown and JSON, or read the original wiki page.

Description

Creates an object of the given type. The Created object is not transferred through network in MP games. netId of such vehicle in multiplayer will be "0:0". To disable local vehicle creation, use CfgDisabledCommands to blacklist this command. Alternatively, you can use createSimpleObject with local option enabled where applicable.

Syntax

Syntax 1

type createVehicleLocal position

Parameters:

Returns: Object

Syntax 2

since arma3 2.14

createVehicleLocal [type, position, markers, placement, special]

Parameters:

Returns: Object - created vehicle or objNull if failed

Examples

Example 1

_lightSource = "#lightpoint" createVehicleLocal _pos;

Example 2

Multiple types:

private _lightSource =        "#lightsource"        createVehicleLocal _pos;    // see [[Light Source Tutorial]]
private _lightReflector =    "#lightreflector"    createVehicleLocal _pos;    // see [[Light Source Tutorial]] - since Arma 3 v2.06
private _particleSource =    "#particlesource"    createVehicleLocal _pos;    // see [[Particles Tutorial]]
private _dynamicSound =        "#dynamicsound"        createVehicleLocal _pos;    // see [[createSoundSource]]

Example 3

// since Arma 3 v2.14
private _lightPoint = createVehicleLocal ["#lightpoint", getMarkerPos "marker1", ["marker2", "marker3"], 0, "NONE"];

See also

createVehicle · createMine · deleteVehicle · createUnit

Community notes

Kronzky

If the object that is created is of the type ammo, then it will created on all clients (tested only on VBS2).

DamonDaemon

Indeed the type of Ammo is transfered to ALL clients, but apparently also the muzzle effects (firing sound, light, etc.); this includes muzzles from Horns (Truck or Car Horn, Bicycle bells, etc.) as well as any other weapon. Tested on ArmA - Arma 2:OA (latest patch).

demellion

WARNING: Do not instigate createVehicle or createVehicleLocal within a server function executed with preInit flag.

This will cause "You cannot play/edit this mission" for a vehicles compiled from a -mod and make server skip/loop that mission init.