---
name: "BIS_fnc_initVehicle"
type: function
status: ok
groups: ["Vehicles"]
arma3_since: "1.42"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_initVehicle
revid: 363633
updated: 2024-04-08T21:57:03Z
---

# BIS_fnc_initVehicle

*Function · Vehicles · Arma 3 v1.42*

Locality: arguments **local** · effect **global**

## Description

This function changes the textures, animation sources and/or mass of a given vehicle.

Unless explicitly mentioned , the function will restore the initial state of every animation sources of the given object (see [#Example 3](../functions/BIS_fnc_initVehicle.md#example-3)).

## Syntax

```sqf
[vehicle, variant, animations, mass] call BIS_fnc_initVehicle
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md) - vehicle to customize
- `variant`: (Optional, default [false](../commands/false.md))
  - [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to restore default texture source, [false](../commands/false.md) to skip texture source change
  - [Array](../topics/Array.md) - texture sources with their probability in format `["textureSource1", 0.5, "textureSource2", 0.5]`
  - [String](../topics/String.md) - variant class name - from `configFile >> "CfgVehicles"` or `missionConfigFile >> "CfgVehicleTemplates"` (see [CfgVehicleTemplates](../topics/Description.ext.md#cfgvehicletemplates))
  - [Number](../topics/Number.md) - index of the texture source (same as the old system)
- `animations`: (Optional, default [false](../commands/false.md))
  - [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to restore init phase of every animation sources
  - [Array](../topics/Array.md) - animation sources with their probability in format `["animationSource1", 0.5, "animationSource2", 0.5]`

  > [!IMPORTANT]
  > If the first element is wrong, it will skip the rest of the animation sources!

  - [String](../topics/String.md) - variant class name - from `configFile >> "CfgVehicles"` or `missionConfigFile >> "CfgVehicleTemplates"` (see [CfgVehicleTemplates](../topics/Description.ext.md#cfgvehicletemplates))
- `mass`: (Optional, default [false](../commands/false.md))
  - [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to set the default mass, [false](../commands/false.md) to disable the mass change
  - [Number](../topics/Number.md) - mass to remove/add to the vehicle

**Returns:** [Boolean](../topics/Boolean.md) - function success or not

## Examples

### Example 1

```sqf
result = [this, "", []] call BIS_fnc_initVehicle;
```

### Example 2

```sqf
result = [this, ["MyTextureSource1", 0.5, "MyTextureSource2", 0.6], []] call BIS_fnc_initVehicle;
```

### Example 3

```sqf
result = [this, nil, ["MyAnimationSource1", 0.5, "MyAnimationSource2", 0.7]] call BIS_fnc_initVehicle;
```

### Example 4

```sqf
// randomise camo net options with 50% probability
[vehicle player, false, ["showcamonethull", 0.5, "showcamonetturret", 0.5, "showcamonetcannon", 0.5, "showslathull", 0.5]] call BIS_fnc_initVehicle;
```

### Example 5

```sqf
// force show all camo net options. Use animationNames to get all available animation sources. Vehicles that don't support certain animations are simply ignored.
[vehicle player, false, ["showcamonethull", 1, "showcamonetturret", 1, "showcamonetcannon", 1, "showslathull", 1]] call BIS_fnc_initVehicle;
```

## See also

[BIS_fnc_saveVehicle](../functions/BIS_fnc_saveVehicle.md) · [BIS_fnc_loadVehicle](../functions/BIS_fnc_loadVehicle.md) · Arma 3: Vehicle Customisation

<sub>Source: [BI Community Wiki — BIS fnc initVehicle](https://community.bistudio.com/wiki/BIS_fnc_initVehicle) (revision 363633).</sub>
