{"name":"addWeaponCargo","operator":null,"title":"addWeaponCargo","type":"command","url":"https://community.bistudio.com/wiki/addWeaponCargo","revid":376383,"updated":"2025-10-09T02:14:03Z","groups":["Containers"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"local","server_exec":false},"exec":null,"description":"Add weapons to the cargo space of vehicles, which can be taken out by infantry units. Ignores available cargo space.\n\n> [!NOTE]\n> **Arma 3:** In Arma 3, arguments for this command must be local (Local Argument). For global variant see addWeaponCargoGlobal.","syntaxes":[{"syntax":"vehicleName addWeaponCargo [weaponName, count]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicleName","type":"Object","optional":false,"default":null,"description":"vehicle to which add the weapons","types":["Object"],"since":null,"text":"vehicleName: Object - vehicle to which add the weapons"},{"name":"weaponName","type":"String","optional":false,"default":null,"description":"weapon name. See Category:Weapons for reference about possible values","types":["String"],"since":null,"text":"weaponName: String - weapon name. See Category:Weapons for reference about possible values"},{"name":"count","type":"Number","optional":false,"default":null,"description":"number of weapons to add. Arma 3 v2.14 negative count will remove weapons.","types":["Number"],"since":null,"text":"count: Number - number of weapons to add. Arma 3 v2.14 negative count will remove weapons."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicleName","types":["Object"]},"right":{"text":"[weaponName, count]","types":["Array"]}}],"examples":[{"text":"```sqf\n_truck addWeaponCargo [\"M16\", 5];\n```","code":["_truck addWeaponCargo [\"M16\", 5];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["addWeaponCargoGlobal","addMagazineCargo","addMagazineCargoGlobal","clearMagazineCargo","clearWeaponCargo","getWeaponCargo","addItemCargo","addItemCargoGlobal","addBackpackCargo","addBackpackCargoGlobal","addWeaponWithAttachmentsCargo"],"notes":[{"user":"Galzohar","date":"2010-07-10T11:02:00Z","text":"When players add/remove gear directly via the gear menu that gear is synchronized across the network. Since this command is local only, using it during a mission can cause all sorts of weird issues. To get proper synchronization use this command in the object's init line or in a script called from its init line with a **call compile preprocessFile** command (and *not* **execVM**)."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Containers","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}