setVehicleCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^ ]+) <\/code>" to "<code>$1</code>")
m (Text replacement - "<code>([^\[]+)<\/code>" to "<sqf>$1</sqf>")
Line 21: Line 21:


|x1= Blackfish with no vehicle cargo loaded
|x1= Blackfish with no vehicle cargo loaded
<code>_success = blackfish setVehicleCargo offroad; // true</code>
<sqf>_success = blackfish setVehicleCargo offroad; // true</sqf>


|x2= Blackfish with full cargo already loaded
|x2= Blackfish with full cargo already loaded
<code>_success = blackfish setVehicleCargo offroad; // false</code>
<sqf>_success = blackfish setVehicleCargo offroad; // false</sqf>


|x3= Unload specific loaded vehicle (will paradrop if dropped from high altitude)
|x3= Unload specific loaded vehicle (will paradrop if dropped from high altitude)
<code>_success = objNull setVehicleCargo offroad;</code>
<sqf>_success = objNull setVehicleCargo offroad;</sqf>


|x4= Unload all vehicles (will paradrop if dropped from high altitude)
|x4= Unload all vehicles (will paradrop if dropped from high altitude)
<code>_success = blackfish setVehicleCargo objNull;</code>
<sqf>_success = blackfish setVehicleCargo objNull;</sqf>


|seealso= [[Arma_3_Vehicle_in_Vehicle_Transport| Vehicle in Vehicle Transport ]] [[canVehicleCargo]] [[enableVehicleCargo]] [[getVehicleCargo]] [[isVehicleCargo]] [[vehicleCargoEnabled]]
|seealso= [[Arma_3_Vehicle_in_Vehicle_Transport| Vehicle in Vehicle Transport ]] [[canVehicleCargo]] [[enableVehicleCargo]] [[getVehicleCargo]] [[isVehicleCargo]] [[vehicleCargoEnabled]]

Revision as of 20:08, 13 May 2022

Hover & click on the images for description

Description

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.
Groups:
Vehicle in Vehicle Transport

Syntax

Syntax:
vehicle setVehicleCargo cargo
Parameters:
vehicle: Object - vehicle for carrying cargo, objNull to unload specific loaded cargo
cargo: Object - cargo to put/loaded in vehicle, objNull to unload all loaded cargo
Return Value:
Boolean - whether or not operation was a success

Examples

Example 1:
Blackfish with no vehicle cargo loaded
_success = blackfish setVehicleCargo offroad; // true
Example 2:
Blackfish with full cargo already loaded
_success = blackfish setVehicleCargo offroad; // false
Example 3:
Unload specific loaded vehicle (will paradrop if dropped from high altitude)
_success = objNull setVehicleCargo offroad;
Example 4:
Unload all vehicles (will paradrop if dropped from high altitude)
_success = blackfish setVehicleCargo objNull;

Additional Information

See also:
Vehicle in Vehicle Transport canVehicleCargo enableVehicleCargo getVehicleCargo isVehicleCargo vehicleCargoEnabled

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note


Posted on July 4, 2016 - 18:46 (UTC)
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: BIforums