---
name: "setVehicleCargo"
type: command
status: ok
groups: ["Vehicle in Vehicle Transport"]
arma3_since: "1.62"
locality: {"argument": null, "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setVehicleCargo
revid: 349523
updated: 2023-11-08T17:15:54Z
---

# setVehicleCargo

*Command · Vehicle in Vehicle Transport · Arma 3 v1.62*

Locality: effect **global**

## Description

Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded.  Can also be used to unload a specific loaded vehicle or all loaded vehicles.

## Syntax

```sqf
vehicle setVehicleCargo cargo
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md) - vehicle for carrying cargo, [objNull](../commands/objNull.md) to unload specific loaded cargo
- `cargo`: [Object](../topics/Object.md) - cargo to put/loaded in vehicle, [objNull](../commands/objNull.md) to unload all loaded cargo

**Returns:** [Boolean](../topics/Boolean.md) - whether or not operation was a success

## Examples

### Example 1

Blackfish with no vehicle cargo loaded

```sqf
private _success = blackfish setVehicleCargo offroad; // true
```

### Example 2

Blackfish with full cargo already loaded

```sqf
private _success = blackfish setVehicleCargo offroad; // false
```

### Example 3

Unload specific loaded vehicle (will paradrop if dropped from high altitude)

```sqf
private _success = objNull setVehicleCargo offroad;
```

### Example 4

Unload all vehicles (will paradrop if dropped from high altitude)

```sqf
private _success = blackfish setVehicleCargo objNull;
```

## See also

Arma 3: Vehicle in Vehicle Transport · [canVehicleCargo](../commands/canVehicleCargo.md) · [enableVehicleCargo](../commands/enableVehicleCargo.md) · [getVehicleCargo](../commands/getVehicleCargo.md) · [isVehicleCargo](../commands/isVehicleCargo.md) · [vehicleCargoEnabled](../commands/vehicleCargoEnabled.md)

## Community notes

**ImperialAlex** — 2016-07-04

`objNull setVehicleCargo _cargoVehicle` - will unload specific loaded vehicle, and `_trasportVehicle setVehicleCargo objNull` will unload all vehicles. The unloaded vehicles will be paradropped if the altitude is high enough. See: [BIforums](https://forums.bistudio.com/topic/191678-vehicle-in-vehicle-transport-feedback/page-5#entry3056397)

<sub>Source: [BI Community Wiki — setVehicleCargo](https://community.bistudio.com/wiki/setVehicleCargo) (revision 349523).</sub>
