Page tree
Skip to end of metadata
Go to start of metadata

Introduced in

Version:1.00

Description

Description:Add weapons to the cargo space of vehicles, which can be taken out by infantry units. Once the weapon cargo space is filled up, any further addWeaponCargo commands are ignored.

Syntax

Syntax:vehicle addWeaponCargo [weaponName, count, createObject]
Parameters:
  • vehicle: Object - Vehicle to add the weapons to.
  • weaponName: String - Weapon class name. See the CfgWeapons Config Reference for possible values.
  • count: Number - Number of weapons to add.
  • createObject: Boolean - If true, creates an object reference, while creating the weapon in cargo (optional, default: false) (V3.9+).
Return Value:Nothing

Alternative Syntax

Syntax:unit addWeaponCargo [weaponName, count, createObject] (V3.9+)
Parameters:
  • unit: Object - Unit to add the weapons to.
  • weaponName: String - Weapon class name.
  • count: Number - Number of weapons to add.
  • createObject: Boolean - If true, creates an object reference, while creating the weapon in cargo (optional, default: false).
Return Value:Array - Array containing objects referencing new weapons.

Alternative Syntax #2

Syntax:unit addWeaponCargo [weapon, count, createObject] (V3.9+)
Parameters:
  • unit: Object - Unit to add the weapons to.
  • weapon: Object - Weapon object.
  • count: Number - Number of weapons to add.
  • createObject: Boolean - No effect (optional, default: false).
Return Value:Array - Array containing objects referencing new weapons.

Examples

Examples:
_truck addWeaponCargo ["M16",5]
_weapons = crate addWeaponCargo ["vbs_ucs_colt_m4a1",2,true]

Additional Information

See also: addMagazineCargo, addWeaponCargoGlobal, clearMagazineCargo
Multiplayer:
Problems:

Notes