BIS fnc compatibleMagazines: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<tt>([a-zA-Z0-9\. _"\\']+)<\/tt>" to "{{hl|$1}}")
m (Some wiki formatting)
Line 10: Line 10:
|s1= [weapon, returnHidden] call [[BIS_fnc_compatibleMagazines]]
|s1= [weapon, returnHidden] call [[BIS_fnc_compatibleMagazines]]


|p1= weapon: [[String]] - Classname of the weapon
|p1= weapon: [[String]] - weapon's classname


|p2= returnHidden: [[Boolean]] - (Optional, default [[false]]) [[true]] to also return magazines with scope 1
|p2= returnHidden: [[Boolean]] - (Optional, default [[false]]) [[true]] to also return magazines with scope 1
Line 16: Line 16:
|r1= [[Array]] - Array of magazine classes
|r1= [[Array]] - Array of magazine classes


|x1= <code>["arifle_mx_f"] [[call]] [[BIS_fnc_compatibleMagazines]];</code>
|x1= <sqf>["arifle_mx_f"] call BIS_fnc_compatibleMagazines;</sqf>


|seealso= [[currentMagazine]] [[currentWeapon]]
|seealso= [[currentMagazine]] [[currentWeapon]]
}}
}}


<dl class="command_description">
{{Note
 
|user= PierreMGI
<dt></dt>
|timestamp= 20200901185900
<dd class="notedate">Posted on September 1, 2020 - 18:59 (UTC)</dd>
|text= This function returns all magazines in lower case.<br>
<dt class="note">[[User:pierremgi|pierremgi]]</dt>
<dd class="note">
This function returns all magazines in lower case.<br>
Example:
Example:
<code>[[currentMagazine]] [[player]] // "30Rnd_762x39_AK12_Mag_F"<br>
<sqf>
[[currentWeapon]] [[player]] [[call]] [[BIS_fnc_compatibleMagazines]];   // ["30rnd_762x39_ak12_mag_f",....]<br>
currentMagazine player; // "30Rnd_762x39_AK12_Mag_F"
[[currentMagazine]] [[player]] [[in]] ([[currentWeapon]] [[player]] [[call]] [[BIS_fnc_compatibleMagazines]]) // never works<br>
currentWeapon player call BIS_fnc_compatibleMagazines; // ["30rnd_762x39_ak12_mag_f", ...]
[[toLowerANSI]] [[currentMagazine]] [[player]] [[in]] ([[currentWeapon]] [[player]] [[call]] [[BIS_fnc_compatibleMagazines]]) // works</code>
currentMagazine player in (currentWeapon player call BIS_fnc_compatibleMagazines); // never works
</dd>
toLowerANSI currentMagazine player in (currentWeapon player call BIS_fnc_compatibleMagazines); // works
 
</sqf>
</dl>
}}

Revision as of 15:04, 3 May 2022

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 - weapon's classname
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
PierreMGI - c
Posted on Sep 01, 2020 - 18:59 (UTC)
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