{"name":"addWeaponCargo","title":"addWeaponCargo","type":"command","url":"https://community.bistudio.com/wiki/addWeaponCargo","revid":376383,"updated":"2025-10-09T02:14:03Z","groups":["Containers"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"global","effect":"local"},"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]","params":[{"name":"vehicleName","type":"Object","description":"vehicle to which add the weapons","type_expr":"Object"},{"name":"weaponName","type":"String","description":"weapon name. See Category:Weapons for reference about possible values","type_expr":"String"},{"name":"count","type":"Number","description":"number of weapons to add. Arma 3 v2.14 negative count will remove weapons.","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"vehicleName"},"right":{"text":"[weaponName, count]"}}],"examples":[{"code":["_truck addWeaponCargo [\"M16\", 5];"]}],"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**)."}]}