Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduced in

Version:1.19

Description

Description:

Returns all weapons types and count from a vehicle (or weapon holder - for example, ammunition box) cargo space.

Warning: Since VBS3 3.9.1 0 this function does not contain all weapons, because weapons equipped by units are automatically converted to an Object. This command only returns weapon cargo that has not been converted to objects yet.

In order to access weapons in cargo converted to objects, use scripting command getWeaponObjectsCargo.

In order to return also object weapons cargo in format compatible with this scripting command in versions 3.9.1 and above, please use fn_vbs_getWeaponAndObjectCargo function instead.

Syntax

Syntax:getWeaponCargo vehicle
Parameters:
  • vehicle: Object - Object to check.
Return Value:Array - [["classname", count], ["classname", count], ...]

Examples

Examples:
_content = getWeaponCargo tankAlpha
_content = getWeaponCargo ammoBox1

Additional Information

See also: addWeaponCargo, getMagazineCargo, weapons, getWeaponObjectsCargofn_vbs_getWeaponAndObjectCargo
Multiplayer:
Problems:

Notes