setVehicleCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<!-- Appropriate categories go here -->" to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3
|1.62|Game version=
|1.62


|gr1= Vehicle in Vehicle Transport |GROUP1=
|gr1= Vehicle in Vehicle Transport


| 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. |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.


| vehicle [[setVehicleCargo]] cargo |SYNTAX=
| vehicle [[setVehicleCargo]] cargo


|p1= vehicle: [[Object]] - vehicle carrying cargo |PARAMETER1=
|p1= vehicle: [[Object]] - vehicle carrying cargo


|p2=  cargo: [[Object]] - cargo to put in vehicle |PARAMETER2=
|p2=  cargo: [[Object]] - cargo to put in vehicle


| [[Boolean]] - whether the vehicle was able to be loaded |RETURNVALUE=
| [[Boolean]] - whether the vehicle was able to be loaded


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


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


|x3= Unload specific loaded vehicle
|x3= Unload specific loaded vehicle
<code>_success = [[objNull]] [[setVehicleCargo]] offroad;  
<code>_success = [[objNull]] [[setVehicleCargo]] offroad;  
</code> |EXAMPLE3=
</code>


|x4= Unload all vehicles
|x4= Unload all vehicles
<code>_success = blackfish [[setVehicleCargo]] [[objNull]];
<code>_success = blackfish [[setVehicleCargo]] [[objNull]];
</code> |EXAMPLE4=
</code>


| [[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 11:11, 18 January 2021

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 carrying cargo
cargo: Object - cargo to put in vehicle
Return Value:
Boolean - whether the vehicle was able to be loaded

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 _success = objNull setVehicleCargo offroad;
Example 4:
Unload all vehicles _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
From biforums: "objnull setVehicleCargo cargo vehicle - will unload specific loaded vehicle" and "transporting vehicle setVehicleCargo objnul - unload all vehicles"