compatibleItems

From Bohemia Interactive Community
Revision as of 16:35, 8 November 2023 by Lou Montana (talk | contribs) (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *W([a-z ])" to "$1 - w$2")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Returns all items (attachments) that can be mounted on the given weapon.
Groups:
Weapons

Syntax

Syntax:
compatibleItems weapon
Parameters:
weapon: String - weapon class name
Return Value:
Array of Strings - compatible attachments

Alternative Syntax

Syntax:
compatibleItems [weapon, slot]
Parameters:
weapon: String - weapon class name
slot: String - class name of the slot (defined under WeaponSlotsInfo class in weapon config)
Return Value:
Array of Strings - compatible attachments

Examples

Example 1:
compatibleItems "arifle_Katiba_GL_F"; // ["optic_Nightstalker","optic_tws","optic_tws_mg","optic_NVS", ...]
Example 2:
compatibleItems ["arifle_Katiba_GL_F", "PointerSlot"]; // ["acc_flashlight","acc_flashlight_broken","acc_pointer_IR", ...]

Additional Information

See also:
compatibleMagazines BIS_fnc_compatibleItems canAdd

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