compatibleItems: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|branch= *dev " to "")
m (examples)
Line 24: Line 24:


|x1= <sqf>
|x1= <sqf>
compatibleItems "arifle_Katiba_GL_F" // ["optic_Nightstalker","optic_tws","optic_tws_mg","optic_NVS", ...]
compatibleItems "arifle_Katiba_GL_F"; // ["optic_Nightstalker","optic_tws","optic_tws_mg","optic_NVS", ...]
</sqf>
</sqf>


|x2= <sqf>
|x2= <sqf>
compatibleItems ["arifle_Katiba_GL_F", "PointerSlot"] // ["acc_flashlight","acc_flashlight_broken","acc_pointer_IR", ...]
compatibleItems ["arifle_Katiba_GL_F", "PointerSlot"]; // ["acc_flashlight","acc_flashlight_broken","acc_pointer_IR", ...]
</sqf>
</sqf>


|seealso= [[compatibleMagazines]] [[BIS_fnc_compatibleItems]] [[canAdd]]
|seealso= [[compatibleMagazines]] [[BIS_fnc_compatibleItems]] [[canAdd]]
}}
}}

Revision as of 10:12, 28 August 2022

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