CityRP Documentation Repository

core.plugins.doors.sh_init

Door Shared

Functions

Sharedcityrp.door.blowDoor(entity, breachpos)Source ☍

Blows open a door or forces passengers from a vehicle.

Parameters

  • entityEntityDoor or vehicle being blown open.
  • breachposVectorCentre of the explosion.
Sharedcityrp.door.getLinkedDoor(door) → Entity?Source ☍

Return the paired door entity for a double-door setup, if one exists.

Parameters

  • doorEntityDoor whose paired leaf should be resolved.

Returns

  1. Entity?Paired door leaf, or nil when none exists.
Sharedcityrp.door.getOwner(door) → Player?Source ☍

Resolves the owning player of a door, following the property's main door. Vacating sets the owner to the world entity, so this checks for a player.

Parameters

  • doorEntityThe door to resolve the owner of.

Returns

  1. Player?The owning player, or nil when unowned.
Sharedcityrp.door.hasLockAccess(ply, door) → booleanSource ☍

Client-safe check for whether a player can lock or unlock a door.

Parameters

Returns

  1. booleanTrue when the player may lock or unlock the door.
Sharedcityrp.door.isDoor(ent) → booleanSource ☍

Returns whether an entity is a supported door type.

Parameters

Returns

  1. booleanTrue when the entity is a supported door.
Sharedcityrp.door.isLocked(ent) → booleanSource ☍

Returns whether a door is currently locked.

Parameters

  • entEntityThe door entity to check.

Returns

  1. booleanTrue when the door is locked.
Sharedcityrp.door.openDoor(ent, delay, unlock, sound)Source ☍

Opens a door after an optional forced unlock.

Parameters

  • entEntityDoor to open.
  • delaynumberTime to wait before opening.
  • unlockboolean?Whether the door should be force-unlocked.
  • soundboolean?Whether an impact sound should be played.
Sharedcityrp.door.pickDoor(ent, ply, sound)Source ☍

Unlocks a door or vehicle after a successful lockpick.

Parameters

  • entEntityDoor or vehicle that was lockpicked.
  • plyPlayerPlayer who lockpicked the entity.
  • soundbooleanWhether the entity should play an impact sound.
Sharedcityrp.door.ramDoor(ent, ply, sound)Source ☍

Rams a door open.

Parameters

  • entEntityDoor to ram.
  • plyPlayerPlayer ramming the door.
  • soundbooleanWhether an impact sound should be played.
Sharedcityrp.door.setLocked(door, locked, delay)Source ☍

Lock or unlock a door and network the new state to clients. The lock state is read on the client for look-at hints, so every lock change has to go through here instead of firing the input directly, otherwise the hint gets stuck on whatever the last networked state was.

Parameters

  • doorEntityThe door to lock or unlock.
  • lockedbooleanTrue to lock the door, false to unlock it.
  • delaynumber?Seconds to wait before the input fires. Defaults to 0.

Tables

Sharedcityrp.doorSource ☍

Fields

Sharedcityrp.door.brushThrowSpeedSource ☍

How fast a breached brush door leaves, in units per second, whatever it weighs. A brush door's mass comes from its size, so the push is scaled by it.