Doors¶
This page documents the hooks defined by the doors module.
CanPlayerLock(client, door)View Source
Purpose
Determines whether a player is allowed to start the key-based door or vehicle locking action.
Realm
Server
Parameters
Player client The player attempting to lock the target entity.
Entity door The targeted door, vehicle, or simfphys vehicle.
Returns
boolean|nil Return false to block the locking action. Returning nil allows the default permission checks to continue.
CanPlayerUnlock(client, door)View Source
Purpose
Determines whether a player is allowed to start the key-based door or vehicle unlocking action.
Realm
Server
Parameters
Player client The player attempting to unlock the target entity.
Entity door The targeted door, vehicle, or simfphys vehicle.
Returns
boolean|nil Return false to block the unlocking action. Returning nil allows the default permission checks to continue.
CanPlayerUseDoor(client, door)View Source
Purpose
Determines whether a player may use a door before the module applies its default interaction handling.
Realm
Server
Parameters
Returns
boolean|nil Return false to deny the use attempt. Returning nil allows the default door-use flow to continue.
CollectDoorDataFields(fields)View Source
Purpose
Allows plugins or modules to register additional door data fields before default door data is built.
Realm
Shared
Parameters
table fields Mutable table that should be populated with custom field definitions. Each key should map to field information such as `default` and, when database-backed, `type`.
DoorLockToggled(client, door, state)View Source
FilterDoorInfo(entity, doorData, doorInfo)View Source
GetDoorInfo(entity, doorData, doorInfo)View Source
GetDoorInfoForAdminStick(target, extraInfo)View Source
KeyLock(client, door, time)View Source
KeyUnlock(client, door, time)View Source
PlayerUseDoor(client, door)View Source
Purpose
Runs after door-use permission checks succeed, allowing modules to override the final use result.
Realm
Server
Parameters
Returns
boolean|nil Return a non-nil value to override the final result of the use attempt. Returning nil leaves the default behavior unchanged.
PostDoorDataLoad(ent, doorData)View Source
Purpose
Called after persisted or preset door data is assembled, before it is cached on the entity.
Realm
Server
Parameters
Entity ent The door entity receiving the loaded data.
table doorData The resolved door data table about to be cached.
Returns
table|nil Return a replacement door data table to modify the loaded values, or nil to keep the original table.
PreDoorDataSave(door, doorData)View Source
Purpose
Called before cached door data is normalized and written back to persistent storage.
Realm
Server
Parameters
Entity door The door entity whose data is about to be saved.
table doorData The current resolved door data table that will be serialized.
Returns
table|nil Return a replacement door data table to change what gets saved, or nil to keep the current values.