CityRP Documentation Repository

core.plugins.doors.sv_init

Door / Property Plugin

This module handles the majority of door interaction, along with the backend for the properties system.

Functions

Servercityrp.door.commands.access(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.color(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.name(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.propertyname(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.purchase(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.rentpayer(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.rentpayerrem(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.sell(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.commands.sellall(ply, door, mainDoor, arguments)Source ☍

Parameters

  • plyany
  • doorany
  • mainDoorany
  • argumentsany
Servercityrp.door.getPrice(door) → numberSource ☍

Get the purchase price of the property a door belongs to.

Parameters

  • doorEntityAny door belonging to the property.

Returns

  1. numberThe price of the property, or 0 if the door isn't part of a property.
Servercityrp.door.getProperty(door) → table?Source ☍

Resolve the property a door belongs to. This reads cityrp.door.properties rather than the networked vars on the door, so it is authoritative even before (or if) the networked vars have replicated to a client.

Parameters

  • doorEntityAny door belonging to the property.

Returns

  1. table?The property entry ({name, doors, rent, dbId}), or nil if the door isn't part of a property.
Servercityrp.door.getPropertyName(door) → stringSource ☍

Get the name of the property a door belongs to.

Parameters

  • doorEntityAny door belonging to the property.

Returns

  1. stringThe property name, or an empty string if the door isn't part of a property.
Servercityrp.door.load()Source ☍

Function called on DB connection to load map properties.

Servercityrp.door.lock(ply, ent) → booleanSource ☍

Lock a door or owned vehicle, including any paired door leaf.

Parameters

Returns

  1. booleanTrue when a lock action was attempted.
Servercityrp.door.unlock(ply, ent) → booleanSource ☍

Unlock a door or owned vehicle, including any paired door leaf.

Parameters

Returns

  1. booleanTrue when an unlock action was attempted.
Serverpropcommand(ply, args)Source ☍

Parameters

  • plyany
  • argsany

Tables

Servercityrp.door.colorsSource ☍
Servercityrp.door.commandsSource ☍

A table to store our command handlers.

Servercityrp.door.propertiesSource ☍

A list of current properties.