BIS fnc compatibleMagazines: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|gr([0-9]+) = " to "|gr$1= ")
m (formatting)
Line 3: Line 3:
|game1= arma3
|game1= arma3


|version1= 1.95
|version1= 1.96


|gr1= Weapons
|gr1= Weapons


|descr= Get all compatible magazines for selected weapons. Function looks both for magazines listed in "magazines" array & compatibile magazineWells.
|descr= Gets all compatible magazines for selected weapons. Function looks both for magazines listed in <tt>magazines</tt> array and compatible <tt>magazineWells</tt>.


|s1= [weapon, returnHidden] call [[BIS_fnc_compatibleMagazines]]
|s1= [weapon, returnHidden] call [[BIS_fnc_compatibleMagazines]]
Line 13: Line 13:
|p1= weapon: [[String]] - Classname of the weapon
|p1= weapon: [[String]] - Classname of the weapon


|p2= returnHidden: [[Boolean]] - (Optional, default [[false]]) [[true]] to also return magazines with scope 1
|p2= returnHidden: [[Boolean]] - (Optional, default [[false]]) [[true|True]] to also return magazines with scope 1


|r1= [[Array]] - Array of magazine classes
|r1= [[Array]] - Array of magazine classes
Line 21: Line 21:
|seealso= [[currentMagazine]] [[currentWeapon]]
|seealso= [[currentMagazine]] [[currentWeapon]]
}}
}}


<dl class="command_description">
<dl class="command_description">

Revision as of 17:46, 20 April 2021

Hover & click on the images for description

Description

Description:
Gets all compatible magazines for selected weapons. Function looks both for magazines listed in magazines array and compatible magazineWells.
Execution:
call
Groups:
Weapons

Syntax

Syntax:
[weapon, returnHidden] call BIS_fnc_compatibleMagazines
Parameters:
weapon: String - Classname of the weapon
returnHidden: Boolean - (Optional, default false) True to also return magazines with scope 1
Return Value:
Array - Array of magazine classes

Examples

Example 1:
["arifle_mx_f"] call BIS_fnc_compatibleMagazines;

Additional Information

See also:
currentMagazine currentWeapon

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
Posted on September 1, 2020 - 18:59 (UTC)
pierremgi
This function returns all magazines in lower case.
Example: currentMagazine player // "30Rnd_762x39_AK12_Mag_F"
currentWeapon player call BIS_fnc_compatibleMagazines; // ["30rnd_762x39_ak12_mag_f",....]
currentMagazine player in (currentWeapon player call BIS_fnc_compatibleMagazines) // never works
toLowerANSI currentMagazine player in (currentWeapon player call BIS_fnc_compatibleMagazines) // works