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



Introduced in

Version:2.11

Description

Description:

Returns the time it takes to reload a unit weapon.

The value returned is the weapon ReloadTime configuration parameter, which defines the minimum time between shots (how long it takes a bullet to go from the magazine into the chamber).

The configuration parameter MagazineReloadTime, which defines the time it takes to change a magazine, is a different configuration parameter, and not returned by this command.

Syntax

Syntax:unit getWeaponReloadTime type
Parameters:
  • unit: Object - Unit to check.
  • type: String - The type of weapon to inquire about. Can be:
    • "PRIMARY"
    • "SECONDARY"
    • "HANDGUN"
    • "BINOCULAR"
Return Value:

Number - Reload time (in seconds), as defined in its reloadTime configuration parameter (see Weapon Parameters in the VBS Developer Reference). For secondary weapons (for example, launchers), the actual time it takes to get ready for another shot may be significantly higher than the number returned by this command.

Returns nil, if the unit does not have the specified weapon type.

Examples

Examples:
_rt = player getWeaponReloadTime "handgun"; // might return 0.9

Additional Information

See also:
Multiplayer:
Problems:

Notes