CBA_fnc_removeWeaponCargo

Description

Removes specific weapon(s) from cargo space.

Warning: All weapon attachments/magazines 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 weapon(s) to remove STRING
_countNumber of weapon(s) to remove <NUMBER> (Default: 1)
_keepAttachmentsKeep attachments/magazines of the removed weapon <BOOLEAN> (Default: false)

Returns

true on success, false otherwise <BOOLEAN>

Examples

// Remove 1 Binocular from a box
_success = [myCoolWeaponBox, "Binocular"] call CBA_fnc_removeWeaponCargo;

// Remove 2 M16A2 from a box
_success = [myCoolWeaponBox, "M16A2", 2] call CBA_fnc_removeWeaponCargo;

// Remove 1 MX (with ACO and IR pointer) from a box and keep attachments
_success = [myCoolWeaponBox, "arifle_MX_ACO_pointer_F", 1, true] call CBA_fnc_removeWeaponCargo;

Author

silencer.helling3r 2012-12-22, Jonpas

string used by format
Close