BIS fnc limitWeaponItems: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
m (Some wiki formatting)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function
{{RV|type=function


| arma3
|game1= arma3
|version1= 1.00


|1.00
|gr1= Inventory


|gr1 = Inventory
|descr= Keeps or remove unit's weapon attachments based on probability user sets. Apply for primary, secondary or handgun weapon separately.


| Keeps or remove unit's weapon attachments based on probability user sets. Apply for primary, secondary or handgun weapon separately.
|s1= [unit, mode, chanceOptics, chanceAttach, chanceMuzzle, chanceUnderbarrel] call [[BIS_fnc_limitWeaponItems]]


| [unit,mode,chanceOptics,chanceAttach,chanceMuzzle,chanceUnderbarrel] call [[BIS_fnc_limitWeaponItems]]
|p1= unit: [[Object]] - target unit


|p2= mode: [[Number]] - (Optional, default 0) can be:
* 1 = primary weapon
* 2 = secondary weapon
* 3 = handgun


|p1= unit: [[Object]] - Target unit
|p3= chanceOptics: [[Number]] or [[Array]] in format ["itemClass", chance] - (Optional, default 50) chance to keep optics from 0 to 100%


|p2= mode: [[Number]] - (Optional, default 0) Can be:
* if ["itemClassname", number] is used, the function will add that attachment if it passes the check. If not, the current attachment will be removed.
*1 = primary weapon
*2 = secondary weapon
*3 = handgun


|p3= chanceOptics: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) Chance to keep optics from 0 to 100%
|p4= chanceAttach: [[Number]] or [[Array]] in format ["itemClass", chance] - (Optional, default 50) chance to keep side attachments 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.
|p5= chanceMuzzle: [[Number]] or [[Array]] in format ["itemClass", chance] - (Optional, default 50) chance to keep muzzle attachment from 0 to 100%


|p4= chanceAttach: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) Chance to keep side attachments from 0 to 100%
|p6= chanceUnderbarrel: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) chance to keep underbarrel attachment from 0 to 100%


|p5= chanceMuzzle: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) Chance to keep muzzle attachment from 0 to 100%
|r1= [[Boolean]]


|p6= chanceUnderbarrel: [[Number]] or [[Array]] in format ["itemClass",chance] - (Optional, default 50) Chance to keep underbarrel attachment from 0 to 100%
|x1= <sqf>player call BIS_fnc_limitWeaponItems;</sqf>


| [[Boolean]]
|x2= <sqf>[[player, 0, 25, 50, 75, 100]] call BIS_fnc_limitWeaponItems;</sqf>


|x1= <code>[[player]] [[call]] [[BIS_fnc_limitWeaponItems]];</code>
|x3= <sqf>[[player, 0, ["optic_lrps", 100], ["acc_pointer_ir", 100], ["muzzle_snds_B", 100], ["bipod_01_F_blk", 100]]] call BIS_fnc_limitWeaponItems;</sqf>


|x2= <code>[ [<nowiki/>[[player]], 0, 25, 50, 75, 100 ] ]  [[call]] [[BIS_fnc_limitWeaponItems]];</code>
|seealso= [[BIS_fnc_limitAmmunition]] [[BIS_fnc_limitItems]]
 
|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>
 
| [[BIS_fnc_limitAmmunition]], [[BIS_fnc_limitItems]]
}}
}}
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:limitWeaponItems}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:limitWeaponItems}}]]

Latest revision as of 12:26, 8 November 2023

Hover & click on the images for description

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 ["itemClassname", number] is used, the function will add that attachment if it passes the check. If not, the current attachment 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

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