compatibleItems: Difference between revisions
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 19: | Line 19: | ||
|p21= weapon: [[String]] - weapon class name | |p21= weapon: [[String]] - weapon class name | ||
|p22= slot: [[String]] - class name of the slot (defined under '''WeaponSlotsInfo''' class in weapon config, for example: "CowsSlot" | |p22= slot: [[String]] - class name of the slot (defined under '''WeaponSlotsInfo''' class in weapon config), for example: | ||
* "CowsSlot" for optics | |||
* "MuzzleSlot" for silencers | |||
* "PointerSlot" for laser pointers and flashlights | |||
* "UnderBarrelSlot" for bipods | |||
|r2= [[Array]] of [[String]]s - compatible attachments | |r2= [[Array]] of [[String]]s - compatible attachments | ||
| Line 31: | Line 35: | ||
</sqf> | </sqf> | ||
|seealso= [[compatibleMagazines]] [[BIS_fnc_compatibleItems]] [[canAdd]] | |seealso= [[compatibleWeapons]] [[compatibleMagazines]] [[BIS_fnc_compatibleItems]] [[canAdd]] | ||
}} | }} | ||
Latest revision as of 21:38, 8 December 2025
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), for example:
- "CowsSlot" for optics
- "MuzzleSlot" for silencers
- "PointerSlot" for laser pointers and flashlights
- "UnderBarrelSlot" for bipods
- 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
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note