{"name":"canAddItemToVest","operator":null,"title":"canAddItemToVest","type":"command","url":"https://community.bistudio.com/wiki/canAddItemToVest","revid":369122,"updated":"2024-09-03T10:33:08Z","groups":["Unit Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.04"}],"since":{"game":"arma3","name":"Arma 3","version":"1.04"},"arma3_since":"1.04","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Checks if given object can be stored into soldier's vest.\n\n> [!IMPORTANT]\n> Avoid passing an empty string `\"\"` to this command as it will create a warning dialog:\n>\n> This message will show once per mission restart.","syntaxes":[{"syntax":"unit canAddItemToVest item","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"item","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"item: String"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"item","types":["String"]}},{"syntax":"unit canAddItemToVest [item, count, ignoreSoldierMaxLoad]","since":"arma3 1.56","effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"item","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"item: String"},{"name":"count","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"count: Number"},{"name":"ignoreSoldierMaxLoad","type":"Boolean","optional":true,"default":"true","description":"true to ignore 'soldierMaxLoad' param, container maxLoad is still counted.","types":["Boolean"],"since":"arma3 2.18","text":"ignoreSoldierMaxLoad: Boolean - (Optional, default true) true to ignore 'soldierMaxLoad' param, container maxLoad is still counted."}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[item, count, ignoreSoldierMaxLoad]","types":["Array"]}}],"examples":[{"text":"```sqf\n_item = \"HandGrenade\";\nprivate _fits = player canAddItemToVest _item;\nif (_fits) then {\n    player addItemToVest _item;\n} else {\n    hint \"no room!\";\n};\n```","code":["_item = \"HandGrenade\";\nprivate _fits = player canAddItemToVest _item;\nif (_fits) then {\n\tplayer addItemToVest _item;\n} else {\n\thint \"no room!\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["canAdd","canAddItemToBackpack","canAddItemToUniform"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Inventory","Introduced with Arma 3 version 1.04","Scripting Commands"]}