CBA_fnc_removeItemCargo

Description

Removes specific item(s) from cargo space.

Warning: All weapon attachments/magazines in containers in container will become detached.  Warning: Preset weapons without non-preset parents will get their attachments readded (engine limitation).

Parameters

_containerObject with cargo <OBJECT>
_itemClassname of item(s) to remove STRING
_countNumber of item(s) to remove <NUMBER> (Default: 1)
_keepContentsKeep contents of the removed item (if uniform/vest) <BOOLEAN> (Default: false)

Returns

true on success, false otherwise <BOOLEAN>

Examples

// Remove 1 GPS from a box
_success = [myCoolItemBox, "ItemGPS"] call CBA_fnc_removeItemCargo;

// Remove 2 Compasses from a box
_success = [myCoolItemBox, "ItemCompass", 2] call CBA_fnc_removeItemCargo;

// Remove 1 Vest from a box and keep contents
_success = [myCoolWeaponBox, "V_PlateCarrier1_rgr", 1, true] call CBA_fnc_removeItemCargo;

Author

Jonpas

string used by format
Close