Type Weapon

Weapon

Methods

clip1() Returns the weapon's primary ammo capacity.
clip2() Returns the weapon's secondary ammo capacity.
getActivity() Returns the current animation the weapon is playing.
getHoldType() Returns the weapon's hold type.
getMaxClip1() Returns the weapon's maximum primary ammo size.
getMaxClip2() Returns the weapon's maximum secondary ammo size.
getPrimaryAmmoType() Returns the weapon's primary ammo type.
getPrintName() Returns a "nice" name for the weapon.
getSecondaryAmmoType() Returns the weapon's secondary ammo type.
getSlot() Returns the slot the weapon lives in.
getSlotPos() Returns the weapon's slot position.
isCarriedByLocalPlayer() Returns whether the weapon is being carried by the local player.
isScripted() Returns true if the weapon is a SWEP (scripted weapon).
isWeaponVisible() Returns true if the weapon is visible.


Methods

Weapon:clip1()
Returns the weapon's primary ammo capacity.

Environment:

Shared

Return value:

    (number) The amount of ammo in the weapon's primary clip.
Weapon:clip2()
Returns the weapon's secondary ammo capacity.

Environment:

Shared

Return value:

    (number) The amount of ammo in the weapon's secondary clip.
Weapon:getActivity()
Returns the current animation the weapon is playing.

Environment:

Shared

Return value:

    (number) ACT_ enum.
Weapon:getHoldType()
Returns the weapon's hold type.

Environment:

Shared

Return value:

    (string) Hold type.
Weapon:getMaxClip1()
Returns the weapon's maximum primary ammo size.

Environment:

Shared

Return value:

    (number) The maximum amount of ammo the weapon's primary clip can hold.
Weapon:getMaxClip2()
Returns the weapon's maximum secondary ammo size.

Environment:

Shared

Return value:

    (number) The maximum amount of ammo the weapon's secondary clip can hold.
Weapon:getPrimaryAmmoType()
Returns the weapon's primary ammo type.

Environment:

Shared

Return value:

    (number | string) The weapon's primary ammo type, either a number or a string.
Weapon:getPrintName()
Returns a "nice" name for the weapon.

Environment:

Shared

Return value:

    (string) The weapon's "nice" name.
Weapon:getSecondaryAmmoType()
Returns the weapon's secondary ammo type.

Environment:

Shared

Return value:

    (number | string) The weapon's secondary ammo type, either a number or a string.
Weapon:getSlot()
Returns the slot the weapon lives in.

Environment:

Shared

Return value:

    (number) The weapon's slot.
Weapon:getSlotPos()
Returns the weapon's slot position.

Environment:

Shared

Return value:

    (number) The weapon's slot position.
Weapon:isCarriedByLocalPlayer()
Returns whether the weapon is being carried by the local player.

Environment:

Client

Return value:

    (boolean) True if the weapon is being carried by the local client player.
Weapon:isScripted()
Returns true if the weapon is a SWEP (scripted weapon).

Environment:

Shared

Return value:

    (boolean) True if it's a SWEP, false otherwise.
Weapon:isWeaponVisible()
Returns true if the weapon is visible.

Environment:

Shared

Return value:

    (boolean) True if the weapon does not have the nodraw flag.

Valid XHTML 1.0!