CityRP Documentation Repository

cityrp_breach_base

Breaching charges SWEP base, shared half. Secondary fire places a charge, primary fire is the clacker. A subclass says where its charges come from: the clip, or an inventory item.

Functions

SharedSWEP:Charges() → integerSource ☍

How many charges the holder has left to place.

Returns

  1. integer
SharedSWEP:Deploy() → booleanSource ☍

Called when the SWEP is drawn.

Returns

  1. boolean
SharedSWEP:Equip(newOwner)Source ☍

Called when the SWEP changes hands. Remembered so the SWEP can still tell its holder after the owner is cleared.

Parameters

SharedSWEP:Holster() → booleanSource ☍

Called when the SWEP is holstered.

Returns

  1. boolean
SharedSWEP:PlayAnim(act)Source ☍

Plays a viewmodel animation, then goes back to the clacker's idle once it has finished. The placing and detonating animations would otherwise hold their last frame in front of the player.

Parameters

  • actintegerAn ACT_SLAM_* activity.
SharedSWEP:SpendCharge()Source ☍

Spends one charge, the way this SWEP keeps them.

Fields

SharedSWEP._HolderSource ☍

The player metatable, with CityRP's own additions to Garry's Mod's Player.

SharedSWEP._IdleAtSource ☍
SharedSWEP.BreachSource ☍

The breach plugin, which owns this weapon. Held here because the loader clears its PLUGIN global once the weapon has registered.

SharedSWEP.HoldTypeSource ☍