{"name":"BIS_fnc_limitWeaponItems","operator":null,"title":"BIS fnc limitWeaponItems","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_limitWeaponItems","revid":348030,"updated":"2023-11-08T11:26:29Z","groups":["Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Keeps or remove unit's weapon attachments based on probability user sets. Apply for primary, secondary or handgun weapon separately.","syntaxes":[{"syntax":"[unit, mode, chanceOptics, chanceAttach, chanceMuzzle, chanceUnderbarrel] call BIS_fnc_limitWeaponItems","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":"target unit","types":["Object"],"since":null,"text":"unit: Object - target unit"},{"name":"mode","type":"Number","optional":true,"default":"0","description":"can be:\n- 1 = primary weapon\n- 2 = secondary weapon\n- 3 = handgun","types":["Number"],"since":null,"text":"mode: Number - (Optional, default 0) can be:\n- 1 = primary weapon\n- 2 = secondary weapon\n- 3 = handgun"},{"name":"chanceOptics","type":"Number or Array in format [\"itemClass\", chance]","optional":true,"default":"50","description":"chance to keep optics from 0 to 100%\n\n- if [\"itemClassname\", number] is used, the function will add that attachment if it passes the check. If not, the current attachment will be removed.","types":["Number","Array"],"since":null,"text":"chanceOptics: Number or Array in format [\"itemClass\", chance] - (Optional, default 50) chance to keep optics from 0 to 100%\n\n- if [\"itemClassname\", number] is used, the function will add that attachment if it passes the check. If not, the current attachment will be removed."},{"name":"chanceAttach","type":"Number or Array in format [\"itemClass\", chance]","optional":true,"default":"50","description":"chance to keep side attachments from 0 to 100%","types":["Number","Array"],"since":null,"text":"chanceAttach: Number or Array in format [\"itemClass\", chance] - (Optional, default 50) chance to keep side attachments from 0 to 100%"},{"name":"chanceMuzzle","type":"Number or Array in format [\"itemClass\", chance]","optional":true,"default":"50","description":"chance to keep muzzle attachment from 0 to 100%","types":["Number","Array"],"since":null,"text":"chanceMuzzle: Number or Array in format [\"itemClass\", chance] - (Optional, default 50) chance to keep muzzle attachment from 0 to 100%"},{"name":"chanceUnderbarrel","type":"Number or Array in format [\"itemClass\",chance]","optional":true,"default":"50","description":"chance to keep underbarrel attachment from 0 to 100%","types":["Number","Array"],"since":null,"text":"chanceUnderbarrel: Number or Array in format [\"itemClass\",chance] - (Optional, default 50) chance to keep underbarrel attachment from 0 to 100%"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"}}],"examples":[{"text":"```sqf\nplayer call BIS_fnc_limitWeaponItems;\n```","code":["player call BIS_fnc_limitWeaponItems;"]},{"text":"```sqf\n[[player, 0, 25, 50, 75, 100]]  call BIS_fnc_limitWeaponItems;\n```","code":["[[player, 0, 25, 50, 75, 100]]  call BIS_fnc_limitWeaponItems;"]},{"text":"```sqf\n[[player, 0, [\"optic_lrps\", 100], [\"acc_pointer_ir\", 100], [\"muzzle_snds_B\", 100], [\"bipod_01_F_blk\", 100]]] call BIS_fnc_limitWeaponItems;\n```","code":["[[player, 0, [\"optic_lrps\", 100], [\"acc_pointer_ir\", 100], [\"muzzle_snds_B\", 100], [\"bipod_01_F_blk\", 100]]] call BIS_fnc_limitWeaponItems;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_limitAmmunition","BIS_fnc_limitItems"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Inventory","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}