compatibleMagazines: Difference between revisions

From Bohemia Interactive Community
m (Some wiki formatting)
(Add v2.22 ammo support)
 
(8 intermediate revisions by 2 users not shown)
Line 4: Line 4:
|version1= 2.10
|version1= 2.10


|branch= dev


|descr= Returns all magazines that can be loaded in the given weapon.
|descr= Returns all magazines that can be loaded in the given weapon or all magazines containing the provided ammo. No compatible magazines are returned for submunition or missiles.


|gr1= Weapons
|gr1= Weapons


|s1= [[compatibleMagazines]] weapon
|s1= [[compatibleMagazines]] weaponOrAmmo


|p1= weapon: [[String]] - Weapon class name
|p1= weaponOrAmmo: [[String]] - weapon class name or {{GVI|arma3|2.22|size= 0.75}} ammo class name


|r1= [[Array]] of [[String]]s - All magazines that can be loaded in '''any muzzle''' of the given weapon.
|r1= [[Array]] of [[String]]s - all magazines that can be loaded in '''any muzzle''' of the given weapon or magazines containing given ammo.


|s2= [[compatibleMagazines]] [weapon, muzzle]
|s2= [[compatibleMagazines]] [weapon, muzzle]


|p21= weapon: [[String]] - Weapon class name
|p21= weapon: [[String]] - weapon class name


|p22= muzzle: [[String]] - Muzzle name
|p22= muzzle: [[String]] - muzzle name ("this" is supported for primary muzzle)


|r2= [[Array]] of [[String]]s - All magazines that can be loaded in the given muzzle of the given weapon.
|r2= [[Array]] of [[String]]s - all magazines that can be loaded in the given muzzle of the given weapon.


|x1= <sqf>compatibleMagazines "arifle_Katiba_GL_F";</sqf>
|x1= <sqf>compatibleMagazines "arifle_Katiba_GL_F";</sqf>
Line 30: Line 29:
|x3= <sqf>compatibleMagazines ["arifle_Katiba_GL_F", "EGLM"];</sqf>
|x3= <sqf>compatibleMagazines ["arifle_Katiba_GL_F", "EGLM"];</sqf>


|seealso= [[compatibleItems]] [[BIS_fnc_compatibleMagazines]] [[canAdd]]
|x4= <sqf>
compatibleMagazines "B_65x39_Caseless_green"; // ["30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green_mag_Tracer"]
</sqf>
 
|seealso= [[compatibleWeapons]] [[compatibleItems]] [[BIS_fnc_compatibleMagazines]] [[canAdd]]
}}
}}

Latest revision as of 17:40, 20 December 2025

Hover & click on the images for description

Description

Description:
Returns all magazines that can be loaded in the given weapon or all magazines containing the provided ammo. No compatible magazines are returned for submunition or missiles.
Groups:
Weapons

Syntax

Syntax:
compatibleMagazines weaponOrAmmo
Parameters:
weaponOrAmmo: String - weapon class name or Arma 3 logo black.png 2.22 ammo class name
Return Value:
Array of Strings - all magazines that can be loaded in any muzzle of the given weapon or magazines containing given ammo.

Alternative Syntax

Syntax:
compatibleMagazines [weapon, muzzle]
Parameters:
weapon: String - weapon class name
muzzle: String - muzzle name ("this" is supported for primary muzzle)
Return Value:
Array of Strings - all magazines that can be loaded in the given muzzle of the given weapon.

Examples

Example 1:
compatibleMagazines "arifle_Katiba_GL_F";
Example 2:
compatibleMagazines ["arifle_Katiba_GL_F", "this"];
Example 3:
compatibleMagazines ["arifle_Katiba_GL_F", "EGLM"];
Example 4:
compatibleMagazines "B_65x39_Caseless_green"; // ["30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green_mag_Tracer"]

Additional Information

See also:
compatibleWeapons compatibleItems BIS_fnc_compatibleMagazines canAdd

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note