BIS fnc limitAmmunition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision imported: BIS Functions update 2/7)
m (pf)
Line 1: Line 1:
 
{{Function|Comments=
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| arma3 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Limits the number of magazines carried by individual unit. Each container (uniform, vest and backpack) can be limited separately or left untouched.
Author: Vaclav "Watty Watts" Oliva
The function limits the number of magazines of each unique ammo category in respective container. Items like First Aid Kit or Mine Detector are not affected by the functio..<br><br>Set the minimum and maximum values in an array, for example [0.5,1] will set the magazine count anywhere between 50-100% of default count.|Description=
____________________________________________________________________________________________


Description:
| [unit,uniformMags,vestMags,BackpackMags] call [[BIS_fnc_limitAmmunition]] |Syntax=
Limits the number of magazines carried by individual unit. Each container (uniform, vest and backpack) can be limited separately or left untouched.
The function limits the number of magazines of each unique ammo category in respective container. Items like First Aid Kit or Mine Detector are not affected by the function.


Set the minimum and maximum values in an array, for example [0.5,1] will set the magazine count anywhere between 50-100% of default count.
|p1=unit: [[Object]] |Parameter 1=


Parameters:
|p2=uniformMags: [[Array]] - (Optional, default [0.4,0.8]) Amount of magazines in uniform. Array in form:
Select 0 - OBJECT: Target unit
*0:minMags - Minimum amount of magazines in percent (%)
Select 1 - ARRAY: Uniform magazines, use [<0-1>,<0-1>] or [] to skip. Default is [0.4,0.8].
*1:maxMags - Maximum amount of magazines in percent (%)|Parameter 2=
Select 2 - ARRAY: Vest magazines, use [<0-1>,<0-1>] or [] to skip. Default is [0.4,0.8].
Select 3 - ARRAY: Backpack magazines, use [<0-1>,<0-1>] or [] to skip. Default is [0.4,0.8].


Returns:
|p3=vestMags: [[Array]] - (Optional, default [0.4,0.8]) Amount of magazines in vest. Array in form:
Boolean
*0:minMags - Minimum amount of magazines in percent (%)
*1:maxMags - Maximum amount of magazines in percent (%)|Parameter 3=


Examples:
|p4=backpackMags: [[Array]] - (Optional, default [0.4,0.8]) Amount of magazines in backpack. Array in form:
_limit = [player] call BIS_fnc_limitAmmunition;
*0:minMags - Minimum amount of magazines in percent (%)
_limit = [player,[],[0.5,0.5],[0,1]] call BIS_fnc_limitAmmunition;
*1:maxMags - Maximum amount of magazines in percent (%)|Parameter 4=
*/


// Params
| [[Boolean]] |Return value=
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_limitAmmunition]]; --> |= Syntax
|x1= <code>[[player]] [[call]] [[BIS_fnc_limitAmmunition]];</code>|Example 1=
|p1= |= Parameter 1


| |= Return value
|x2= <code>[ [[player]],[],[0.5,0.5],[0,1] ] [[call]] [[BIS_fnc_limitAmmunition]];</code>|Example 2=
____________________________________________________________________________________________


|x1= <code></code> |=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[BIS_fnc_limitWeaponItems]], [[BIS_fnc_limitItems]]  |See also=
 
}}
}}



Revision as of 13:55, 20 June 2018

Hover & click on the images for description

Description

Description:
Limits the number of magazines carried by individual unit. Each container (uniform, vest and backpack) can be limited separately or left untouched. The function limits the number of magazines of each unique ammo category in respective container. Items like First Aid Kit or Mine Detector are not affected by the functio..

Set the minimum and maximum values in an array, for example [0.5,1] will set the magazine count anywhere between 50-100% of default count.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[unit,uniformMags,vestMags,BackpackMags] call BIS_fnc_limitAmmunition
Parameters:
unit: Object
uniformMags: Array - (Optional, default [0.4,0.8]) Amount of magazines in uniform. Array in form:
  • 0:minMags - Minimum amount of magazines in percent (%)
  • 1:maxMags - Maximum amount of magazines in percent (%)
vestMags: Array - (Optional, default [0.4,0.8]) Amount of magazines in vest. Array in form:
  • 0:minMags - Minimum amount of magazines in percent (%)
  • 1:maxMags - Maximum amount of magazines in percent (%)
backpackMags: Array - (Optional, default [0.4,0.8]) Amount of magazines in backpack. Array in form:
  • 0:minMags - Minimum amount of magazines in percent (%)
  • 1:maxMags - Maximum amount of magazines in percent (%)
Return Value:
Boolean

Examples

Example 1:
player call BIS_fnc_limitAmmunition;
Example 2:
[ player,[],[0.5,0.5],[0,1] ] call BIS_fnc_limitAmmunition;

Additional Information

See also:
BIS_fnc_limitWeaponItemsBIS_fnc_limitItems

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

Notes

Bottom Section