Arma 3 Scripting

Command in Vehicle in Vehicle Transport

setVehicleCargo

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

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

vehicle setVehicleCargo cargo

Parameters:

Returns: Boolean - whether or not operation was a success

Examples

Example 1

Blackfish with no vehicle cargo loaded

private _success = blackfish setVehicleCargo offroad; // true

Example 2

Blackfish with full cargo already loaded

private _success = blackfish setVehicleCargo offroad; // false

Example 3

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

private _success = objNull setVehicleCargo offroad;

Example 4

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

private _success = blackfish setVehicleCargo objNull;

See also

Arma 3: Vehicle in Vehicle Transport · canVehicleCargo · enableVehicleCargo · getVehicleCargo · isVehicleCargo · vehicleCargoEnabled

Community notes

ImperialAlex

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: