Hooks hooks
Part of Doors
Hooks called by Doors
Summary
Hooks
Doors:set_owner or taken with Doors:clear_owner.Doors:register_property.Doors:register_title_type.Hooks
DoorAccessChanged(root, character_id, level, old_level)
server plugins/doors/plugin/lib/sv_access.lua:98Called on the server after the access of a character to an owned door has changed. Not called when the whole access list goes because the door changes hands.
Parameters
- entity Entity the door, or the main door of its group
- character_id Number ID of the character
- level Number the new level: DOOR_ACCESS_NONE, DOOR_ACCESS_USE or DOOR_ACCESS_MANAGE
- old_level Number the level the character had
Called from
Call sites
Called on the server after the owner of a door has changed: when it is bought, sold,
given with Doors:set_owner or taken with Doors:clear_owner. Not called for the
owners that are restored when the doors are loaded.
Parameters
- entity Entity the door, or the main door of its group
- owner Map the new owner with the id, name, paid and currency fields; nil if the door has no owner anymore
- old_owner Map the previous owner, nil if the door had none
Called from
Call sites
Lets plugins change the name under which a character is put on the access list of a door, for example when the player who gives the access does not know the real name of the character. Called on the server when a character is given access to a door for the first time.
Parameters
- actor Player the player who gives the access
- target Player the player whose active character receives it
- entity Entity the door, or the main door of its group
Returns
- String the name to list the character under; the name of the character is used when nothing is returned
Called from
Call sites
Called on the server when the doors are loaded and no door data has been saved for the map yet. Lets a schema set the doors of the map up for the first time.
Called from
Call sites
Asks whether a player may buy a door. Called on the server once the door is known to be for sale, the character to be under its door limit and the player to have the money, before anything is taken.
Parameters
- actor Player
- entity Entity the door, or the main door of its group
- price Number what the player is about to pay, 0 if the door is free
- currency String ID of the currency of the price, nil if there is none
Returns
- Boolean return false to refuse the purchase
- String error phrase to show the player
- Map arguments of the phrase
Called from
Call sites
PlayerCanChangeDoorAccess(actor, root, character_id, level, old_level)
server plugins/doors/plugin/lib/sv_access.lua:194Asks whether a player may change the access of a character to a door. Called on the server once the player is known to have the right to make the change.
Parameters
- actor Player the player who manages the door
- entity Entity the door, or the main door of its group
- character_id Number ID of the character whose access changes
- level Number the level it is about to have: DOOR_ACCESS_NONE, DOOR_ACCESS_USE or DOOR_ACCESS_MANAGE
- old_level Number the level it has now
Returns
- Boolean return false to refuse the change
- String error phrase to show the player
- Map arguments of the phrase
Called from
Call sites
Asks whether a player may lock and unlock a door. Called on the server when the player opens the menu of the door, when they use the door, when they ask to lock or unlock it from the menu and when a timed locking or unlocking of theirs completes. The Doors plugin itself allows it to those who pass the conditions of the door and to the characters that own the door or have access to it.
Parameters
- actor Player
- entity Entity the door
Returns
- Boolean return true to allow it; the player may not lock the door when nothing is returned
Called from
Call sites
Asks whether a player may sell a door that their character owns. Called on the server before the door is released.
Parameters
- actor Player
- entity Entity the door, or the main door of its group
- refund Number what the player is about to get back, 0 if nothing
- currency String ID of the currency of the refund, nil if there is none
Returns
- Boolean return false to refuse the sale
- String error phrase to show the player
- Map arguments of the phrase
Called from
Call sites
Called on the server when a player uses a door that is within reach and not on its use cooldown, except for the use that has just locked the door.
Parameters
- activator Player
- entity Entity the door
Called from
Call sites
Lets plugins register their door properties with Doors:register_property. Called on the
server and the client once all plugins have been loaded.
Called from
Call sites
Lets plugins register their door title types with Doors:register_title_type. Called on
the server and the client once all plugins have been loaded.