Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.30

Description

Description:

Adds an object or objects to the object cargo of a container (another object). If a string is passed, a new object of that type is created. No test is done to see if the container could actually hold the cargo (no size / weight restrictions). Object cargo is used to store objects, such as cell phones or ammunition cans, which are not weapons or magazines.

Note: Must be called where the container is local.

Syntax

Syntax:[cargo, container] call fn_vbs_objectCargo_add
Parameters:
  • cargo: Array of Object or String - Array of objects (or object class names) to add to the cargo.
  • container: Object - Person, vehicle, or object to add to the cargo.
Return Value:Boolean - Returns true, if successfully added to the cargo, false otherwise.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
[[cone1, "vbs2_ied_object_mobile_phone"], player] call fn_vbs_objectCargo_add
["vbs2_ied_object_mobile_phone", car1] call fn_vbs_objectCargo_add

Additional Information

See also: fn vbs objectCargo get, fn vbs objectCargo remove
Multiplayer: 
Problems: 

Notes