BIS fnc compatibleMagazines: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (page filled and note formatted)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma3 |Game name=
|game1= arma3


|1.95|Game version=
|version1= 1.95


<!---|arg= local |Multiplayer Arguments=--->
<!--|serverExec= server-->


<!---|eff= local |Multiplayer Effects=--->
<!--|arg= local-->


| <pre>/*
<!--|eff= local-->
bis_fnc_compatibleMagazines


Get all compatibile magazines for selected weapons. Function looks both for magazines listed in "magazines" array & compatibile magazineWells
|descr= Get all compatibile magazines for selected weapons. Function looks both for magazines listed in "magazines" array & compatibile magazineWells.


Input:
|s1= [weapon, returnHidden] call [[BIS_fnc_compatibleMagazines]]
0: (String) :
Weapon class name
1: (Bool) [Optional] :
Decide if magazines with scope 1 should be also returned


Output:
|p1= weapon: [[String]] - Classname of the weapon
Array of magazines (strings)


Example:
|p2= returnHidden: [[Boolean]] - (Optional, default [[false]]) [[True]] to also return magazines with scope 1
["arifle_mx_f"] call bis_fnc_compatibleMagazines;
compatibleMagazines
Author: reyhard
*/</pre>{{Informative|Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]]}} |Description=


|[] call [[BIS_fnc_compatibleMagazines]]|Syntax=
|r1= [[Array]] - Array of magazine classes


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
|x1= <code>["arifle_mx_f"] [[call]] [[BIS_fnc_compatibleMagazines]];</code>


|Datatype - description|Return value=
|exec= call


|x1= <code></code>|Example 1=
|seealso= [[currentMagazine]] [[currentWeapon]]


|exec= call |Execution=
| |See also=
}}
}}
[[Category:Function Group: Inventory|{{uc:compatibleMagazines}}]]
[[Category:Function Group: Inventory|{{uc:compatibleMagazines}}]]
[[Category:Functions|{{uc:compatibleMagazines}}]]
[[Category:Functions|{{uc:compatibleMagazines}}]]
Line 52: Line 38:
<dd class="note">
<dd class="note">
This function returns all magazines in lower case.<br>
This function returns all magazines in lower case.<br>
example:<br>
Example:
[[currentMagazine]] player // "30Rnd_762x39_AK12_Mag_F"<br>
<code>
[[currentWeapon]] player call BIS_fnc_compatibleMagazines  // ["30rnd_762x39_ak12_mag_f",....]<br>
[[currentMagazine]] [[player]] // "30Rnd_762x39_AK12_Mag_F"<br>
<code>currentMagazine player [[in]] (currentWeapon player call BIS_fnc_compatibleMagazines) // never work<br>
[[currentWeapon]] [[player]] [[call]] [[BIS_fnc_compatibleMagazines]];   // ["30rnd_762x39_ak12_mag_f",....]<br>
[[toLowerANSI]] currentMagazine player [[in]] (currentWeapon player call BIS_fnc_compatibleMagazines) // work</code>
[[currentMagazine]] [[player]] [[in]] ([[currentWeapon]] [[player]] [[call]] [[BIS_fnc_compatibleMagazines]]) // never works<br>
[[toLowerANSI]] [[currentMagazine]] [[player]] [[in]] ([[currentWeapon]] [[player]] [[call]] [[BIS_fnc_compatibleMagazines]]) // works</code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 12:14, 2 September 2020

Hover & click on the images for description

Description

Description:
Get all compatibile magazines for selected weapons. Function looks both for magazines listed in "magazines" array & compatibile magazineWells.
Execution:
call
Groups:
Uncategorised

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