CityRP Documentation Repository

ITEM.Weapon

The weapon item base.

Registration ID
base_weapon
Inherits
ITEM → ITEM.Weapon

Functions

SharedITEM:BlockGovernment() → ITEMSource ☍

Blocks the government from using this weapon.

Returns

  1. ITEM
SharedITEM:onDestroy(ply)Source ☍

onDestroy hook/override for this item base.

Parameters

SharedITEM:onDrop(ply, pos)Source ☍

onDrop hook/override for this item base.

Parameters

SharedITEM:onGive(ply, amt, to)Source ☍

onGive hook/override for this item base.

Parameters

SharedITEM:onUse(ply) → booleanSource ☍

onUse hook/override for this item base.

Parameters

Returns

  1. boolean
SharedITEM:postUse(ply, old, new) → booleanSource ☍

postUse hook/override for this item base.

Parameters

  • plyPlayer
  • oldstring?
  • newstring?

Returns

  1. boolean
SharedITEM:preUse(ply, old) → booleanSource ☍

preUse hook/override for this item base.

Parameters

Returns

  1. boolean
SharedITEM:uponLoad()Source ☍

uponLoad hook/override for this item base.

Fields

SharedITEM.ammoSource ☍
SharedITEM.ammoSource ☍
SharedITEM.f1infoSource ☍
SharedITEM.f1infoSource ☍
SharedITEM.SetAmmoSource ☍

Sets the type of ammo this weapon uses. If this is not called, this is attempted to be inferred from the weapon type.

SharedITEM.SetWeaponTypeSource ☍

Sets the type of weapon this is.