CBA_fnc_selectWeapon

Description

Selects a weapon including correctly selecting a weapon mode of specified.

Has to be executed on the machine where the unit is local.

Parameters

_unitUnit object to perform function on.  <OBJECT>
_weaponWeapon or muzzle to select STRING
_modeWeapon mode to switch to [optional] STRING (default: “”)

Returns

Success or Failed <BOOLEAN>

Examples

_result = [player, secondaryWeapon player] call CBA_fnc_selectWeapon;
_result = [player, currentWeapon player, "FullAuto"] call CBA_fnc_selectWeapon;
_result = [player, "LMG_M200_body"] call CBA_fnc_selectWeapon;

Author

Sickboy, commy2, johnb43

string used by format
Close