BIS fnc limitWeaponItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>") |
Lou Montana (talk | contribs) m (Text replacement - "(\|p[0-9]+ *= *[^(]+\(Optional(, default[^)]*)\) )C([a-z])" to "$1c$3") |
||
Line 12: | Line 12: | ||
|p1= unit: [[Object]] - Target unit | |p1= unit: [[Object]] - Target unit | ||
|p2= mode: [[Number]] - (Optional, default 0) | |p2= mode: [[Number]] - (Optional, default 0) can be: | ||
*1 = primary weapon | *1 = primary weapon | ||
*2 = secondary weapon | *2 = secondary weapon | ||
*3 = handgun | *3 = handgun | ||
|p3= chanceOptics: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) | |p3= 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. | *If you use ["itemClassname",number], the function will add that attachment if it passes the check. If not, current will be removed. | ||
|p4= chanceAttach: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) | |p4= chanceAttach: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) chance to keep side attachments from 0 to 100% | ||
|p5= chanceMuzzle: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) | |p5= chanceMuzzle: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) chance to keep muzzle attachment from 0 to 100% | ||
|p6= chanceUnderbarrel: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) | |p6= chanceUnderbarrel: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) chance to keep underbarrel attachment from 0 to 100% | ||
|r1= [[Boolean]] | |r1= [[Boolean]] |
Revision as of 12:22, 8 November 2023
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:
- Example 2:
- Example 3:
Additional Information
- See also:
- BIS_fnc_limitAmmunition BIS_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