CityRP Documentation Repository

core.plugins.breach.entities.cityrp_breach.init

Name: "init.lua" Product: "CityRP 2 (Roleplay)" Author: Originally Kudomiku, modifications by Faustie

Functions

ServerENT:BlowDoor(door)Source ☍

Blows a door open, throwing it away from the placer. blowDoor throws a door away from the point it is given, so give it one on the placer's side of the door, which sends it back from them instead of along its face.

Parameters

ServerENT:CancelRemoval(ply, reason)Source ☍

Stops whoever is removing or reclaiming this charge.

Parameters

  • plyPlayer?Told why, when given.
  • reasonstring?
ServerENT:CanReclaim(ply) → boolean, string?Source ☍

Whether the owner could take this charge back now. A SWAT charge goes back into the SWAT SWEP's clip, which has to be in hand and have room.

Parameters

Returns

  1. 1boolean
  2. 2string?
ServerENT:Detonate()Source ☍

Sets the charge off: blows its door open, and the other leaf of its pair with it, destroys props around it and removes the charge.

ServerENT:Explode()Source ☍

Plays the explosion effect at the charge.

ServerENT:FinishRemoval(ply, isOwner)Source ☍

Finishes a removal: the owner gets the charge back, anyone else just removes it. The owner is not told, but the removal is logged.

Parameters

  • plyPlayerWho held the keys.
  • isOwnerbooleanWhether they placed it.
ServerENT:GetRemovalTimerName() → stringSource ☍

The name of the timer that watches someone reclaiming or removing this charge.

Returns

  1. string
ServerENT:IsFitToRemove(ply) → booleanSource ☍

Whether a player is in a fit state to work on a charge: the same states the keys' pickup refuses.

Parameters

Returns

  1. boolean
ServerENT:IsInReachOf(ply) → booleanSource ☍

Whether a player is looking at this charge from close enough to work on it.

Parameters

Returns

  1. boolean
ServerENT:KeyPress(ply, key)Source ☍

Starts removing or reclaiming the charge when a player holds Shift and R while looking at it. The owner reclaims it in reclaimTime; anyone else removes it in removeTime.

Parameters

ServerENT:OnRemove()Source ☍

Stops watching for a removal when the charge goes, and takes the owner's bought SWEP if this was its last.

ServerENT:OnTakeDamage(dmg) → numberSource ☍

Sets the charge off once enough damage has been dealt to it.

Parameters

Returns

  1. number
ServerENT:SetDoor(door, trace)Source ☍

Attaches the charge to the door it will breach, and gives it its health.

Parameters

  • doorEntityThe door, prop or vehicle being breached.
  • traceTraceResultThe placer's eye trace, which says where on it the charge sits.

Fields

ServerENT._DetonatingSource ☍

Blowing a door fires DoorBreached, which removes the charge on it. This one is already going.

ServerENT._DoorSource ☍

The entity metatable, with CityRP's own additions to Garry's Mod's Entity.

ServerENT._nopickupSource ☍

The keys' pickup (cityrp_pickup_base) refuses anything flagged like this, so fists can't carry it off.

ServerENT._NormalSource ☍

Set the position and angles of the entity.

ServerENT._RemoverSource ☍

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

ServerENT.PlacementOffsetSource ☍

Turns applied after the charge is aligned to the surface normal, each about the model's own axis and in this order: roll about its forward axis, pitch about its Y axis, then yaw about its up axis.

ServerENT.SurfaceFitSource ☍

How much of its depth the charge stands off the surface it is placed on: 1 puts the back of its model bounds on the surface, 0 puts their centre on it. The visible SLAM is thinner than its bounds, so it needs less than 1 to touch the surface; negative sinks it further.