BIS fnc limitWeaponItems: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Inventory(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 7: | Line 6: | ||
|gr1 = Inventory |GROUP1= | |gr1 = Inventory |GROUP1= | ||
| Keeps or remove unit's weapon attachments based on probability user sets. Apply for primary, secondary or handgun weapon separately.|Description= | | Keeps or remove unit's weapon attachments based on probability user sets. Apply for primary, secondary or handgun weapon separately.|Description= | ||
| [unit,mode,chanceOptics,chanceAttach,chanceMuzzle,chanceUnderbarrel] call [[BIS_fnc_limitWeaponItems]] |Syntax= | | [unit,mode,chanceOptics,chanceAttach,chanceMuzzle,chanceUnderbarrel] call [[BIS_fnc_limitWeaponItems]] |Syntax= | ||
Line 33: | Line 30: | ||
| [[Boolean]] |Return value= | | [[Boolean]] |Return value= | ||
|x1= <code>[[player]] [[call]] [[BIS_fnc_limitWeaponItems]];</code>|Example 1= | |x1= <code>[[player]] [[call]] [[BIS_fnc_limitWeaponItems]];</code>|Example 1= | ||
Line 40: | Line 36: | ||
|x3= <code>[ [<nowiki/>[[player]], 0, ["optic_lrps",100], ["acc_pointer_ir",100], ["muzzle_snds_B",100], ["bipod_01_F_blk",100] ] ] [[call]] [[BIS_fnc_limitWeaponItems]];</code>|Example 3= | |x3= <code>[ [<nowiki/>[[player]], 0, ["optic_lrps",100], ["acc_pointer_ir",100], ["muzzle_snds_B",100], ["bipod_01_F_blk",100] ] ] [[call]] [[BIS_fnc_limitWeaponItems]];</code>|Example 3= | ||
| [[BIS_fnc_limitAmmunition]], [[BIS_fnc_limitItems]] |See also= | | [[BIS_fnc_limitAmmunition]], [[BIS_fnc_limitItems]] |See also= |
Revision as of 23:22, 16 January 2021
Description
- Description:
- Keeps or remove unit's weapon attachments based on probability user sets. Apply for primary, secondary or handgun weapon separately.
- Execution:
- call
- Groups:
- Inventory
Syntax
- Syntax:
- [unit,mode,chanceOptics,chanceAttach,chanceMuzzle,chanceUnderbarrel] call BIS_fnc_limitWeaponItems
- Parameters:
- unit: Object - Target unit
- mode: Number - (Optional, default 0) Can be:
- 1 = primary weapon
- 2 = secondary weapon
- 3 = handgun
- chanceOptics: Number or Array in format ["itemClass",chance] - (Optional, default 50) Chance to keep optics from 0 to 100%
- If you use ["itemClassname",number], the function will add that attachment if it passes the check. If not, current will be removed.
- chanceAttach: Number or Array in format ["itemClass",chance] - (Optional, default 50) Chance to keep side attachments from 0 to 100%
- chanceMuzzle: Number or Array in format ["itemClass",chance] - (Optional, default 50) Chance to keep muzzle attachment from 0 to 100%
- chanceUnderbarrel: Number or Array in format ["itemClass",chance] - (Optional, default 50) Chance to keep underbarrel attachment from 0 to 100%
- Return Value:
- Boolean
Examples
- Example 1:
player call BIS_fnc_limitWeaponItems;
- Example 2:
[ [player, 0, 25, 50, 75, 100 ] ] call BIS_fnc_limitWeaponItems;
- Example 3:
[ [player, 0, ["optic_lrps",100], ["acc_pointer_ir",100], ["muzzle_snds_B",100], ["bipod_01_F_blk",100] ] ] call BIS_fnc_limitWeaponItems;
Additional Information
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