Summary

Hooks

Called after Catwork has loaded all map entities; restores the permanent doors.
Restores the permanent doors saved for the current map.
Called when a player's access to a door is checked; grants access to the owner of a permanent door.
Removes the owner of a permanent door and saves it as vacant.
Saves the name, text, secret and position of every permanent door to plugins/permadoors/<map>.
Makes a door permanently owned by a player's character and saves it.

Hooks

cwPermaDoors:ClockworkInitPostEntity()

server gamemodes/cwhl2rp/plugins/permadoors/plugin/sv_hooks.lua:28

Implements hook ClockworkInitPostEntity

Called after Catwork has loaded all map entities; restores the permanent doors.

Restores the permanent doors saved for the current map.

Saved doors are matched to map doors by position; each matched door is made unownable, gets its saved name and text, and is added to cwPermaDoors.stored.

See also

cwPermaDoors:PlayerDoesHaveDoorAccess(player, door, access, isAccurate)

server gamemodes/cwhl2rp/plugins/permadoors/plugin/sv_hooks.lua:15

Implements hook PlayerDoesHaveDoorAccess

Called when a player's access to a door is checked; grants access to the owner of a permanent door.

A character owns a permanent door when its PermaDoorSecret character data matches the door's secret.

Parameters

  • player Player The player whose access is checked
  • door Entity The door
  • access Number The DOOR_ACCESS_* level being checked
  • isAccurate Boolean Whether the exact access level must match

Returns

  • Boolean true for the door's owner, otherwise nil to let other hooks decide

cwPermaDoors:ResetPermaDoor(door, title)

server gamemodes/cwhl2rp/plugins/permadoors/plugin/sv_plugin.lua:43

Removes the owner of a permanent door and saves it as vacant.

The door keeps being unownable, gets a new random secret that no character holds and shows #Door_Vacant as its text.

Parameters

  • door Entity The door to reset
  • title String Name shown on the door

See also

Saves the name, text, secret and position of every permanent door to plugins/permadoors/<map>.

A door whose entity no longer exists is saved with its last known position.

See also

cwPermaDoors:SetPermaDoor(player, door, title)

server gamemodes/cwhl2rp/plugins/permadoors/plugin/sv_plugin.lua:15

Makes a door permanently owned by a player's character and saves it.

The character gets a PermaDoorSecret key the first time it is given a door; the door stores that key, becomes unownable and shows the title with the owner's name as its text.

Parameters

  • player Player The new owner
  • door Entity The door to assign
  • title String Name shown on the door

See also

Defined in