Exports
This page lists all cd_doorlock exports, along with their purpose, parameters, and usage examples. All events are located in the [cd_doorlock/integrations] folder.
Note
These exports are entirely optional and can be used as needed within your own scripts or integrations.
Client
Get All Doors
Returns a table containing all doors and their associated data.
--- @return table doors A table of all doors and their full data sets.
--- @example
local doors = exports['cd_doorlock']:GetAllDoors()
print('Total doors:', #doors)
for index, door in pairs(doors) do
print('Name: ', data.door_name)
print('Location Group: ', door.location_group)
print('Unique ID: ', door.unique_id)
endlocal doors = exports['cd_doorlock']:GetAllDoors()Get Door Unique ID
Returns the unique ID of a door. The first and second arguments define which door to retrieve the unique ID from. This unique ID is required for some events and is consistent for the door.
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return string uniqueId The door’s unique ID.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)
print('Door unique ID:', uniqueId)local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)Get Door State (Closest)
Returns the locked state of the closest door.
--- @return boolean state The door’s state (true = locked, false = unlocked).
--- @example
local state = exports['cd_doorlock']:GetDoorState_closest()
if state then
print('The closest door is locked.')
else
print('The closest door is unlocked.')
endlocal state = exports['cd_doorlock']:GetDoorState_closest()Get Door State (By Name)
Returns the locked state of a specific door. The first and second arguments define which door’s state you want to check. This allows you to retrieve whether a specific named door is locked or unlocked.
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return boolean state The door’s state (true = locked, false = unlocked).
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)
if state then
print('The specified door is locked.')
else
print('The specified door is unlocked.')
endlocal state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)Get Door State (By Unique ID)
Returns the locked state of a specific door. The unique ID determines exactly which door’s state you want to check. This allows you to retrieve whether a specific door is locked or unlocked using its unique identifier.
--- @param uniqueId string The unique ID of the door.
--- @return boolean state The door’s state (true = locked, false = unlocked).
--- @example
local uniqueId = '1234-5678'
local state = exports['cd_doorlock']:GetDoorState_uniqueid(uniqueId)
if state then
print('The door is locked.')
else
print('The door is unlocked.')
endlocal state = exports['cd_doorlock']:GetDoorState_closest()Get Door Data (Closest)
Returns the full cached data of the closest door. This function provides all stored information for the nearest door, including its settings, permissions, and configuration data. Useful when you need complete door details for logic, debugging, or UI.
--- @return table doorData The full cached data of the closest door.
--- @example
local data = exports['cd_doorlock']:GetDoorDataFull_closest()
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('No door found nearby.')
endlocal data = exports['cd_doorlock']:GetDoorDataFull_closest()Get Door Data (By Name)
Returns the full cached data of a specific door. The first and second arguments define which door’s data you want to retrieve. This allows you to access all stored information for a specific named door, including its settings, permissions, and configuration data.
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return table doorData The full cached data of the specified door.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
endlocal data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)Get Door Data (By Unique ID)
Returns the full cached data of a specific door. The unique ID determines exactly which door’s data you want to retrieve. This allows you to access all stored information for a specific door, including its settings, permissions, and configuration data.
--- @param uniqueId string The unique ID of the door.
--- @return table doorData The full cached data of the specified door.
--- @example
local uniqueId = '1234-5678'
local data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
endlocal data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)Server
Get All Doors
Returns a table containing all doors and their associated data.
--- @return table doors A table of all doors and their full data sets.
--- @example
local doors = exports['cd_doorlock']:GetAllDoors()
print('Total doors:', #doors)
for index, door in pairs(doors) do
print('Name: ', data.door_name)
print('Location Group: ', door.location_group)
print('Unique ID: ', door.unique_id)
endlocal doors = exports['cd_doorlock']:GetAllDoors()Get Door Unique ID
Returns the unique ID of a door. The first and second arguments define which door to retrieve the unique ID from. This unique ID is required for some events and is consistent for the door.
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return string uniqueId The door’s unique ID.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)
print('Door unique ID:', uniqueId)local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)Get Door State (Closest)
Returns the locked state of the closest door.
--- @return boolean state The door’s state (true = locked, false = unlocked).
--- @example
local state = exports['cd_doorlock']:GetDoorState_closest(source)
if state then
print('The closest door is locked.')
else
print('The closest door is unlocked.')
endlocal state = exports['cd_doorlock']:GetDoorState_closest(source)Get Door State (By Name)
Returns the locked state of a specific door. The first and second arguments define which door’s state you want to check. This allows you to retrieve whether a specific named door is locked or unlocked.
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return boolean state The door’s state (true = locked, false = unlocked).
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)
if state then
print('The specified door is locked.')
else
print('The specified door is unlocked.')
endlocal state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)Get Door State (By Unique ID)
Returns the locked state of a specific door. The unique ID determines exactly which door’s state you want to check. This allows you to retrieve whether a specific door is locked or unlocked using its unique identifier.
--- @param uniqueId string The unique ID of the door.
--- @return boolean state The door’s state (true = locked, false = unlocked).
--- @example
local uniqueId = '1234-5678'
local state = exports['cd_doorlock']:GetDoorState_uniqueid(uniqueId)
if state then
print('The door is locked.')
else
print('The door is unlocked.')
endlocal state = exports['cd_doorlock']:GetDoorState_closest()Get Door Data (Closest)
Returns the full cached data of the closest door. This function provides all stored information for the nearest door, including its settings, permissions, and configuration data. Useful when you need complete door details for logic, debugging, or UI.
--- @return table doorData The full cached data of the closest door.
--- @example
local data = exports['cd_doorlock']:GetDoorDataFull_closest(source)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('No door found nearby.')
endlocal data = exports['cd_doorlock']:GetDoorDataFull_closest(source)Get Door Data (By Name)
Returns the full cached data of a specific door. The first and second arguments define which door’s data you want to retrieve. This allows you to access all stored information for a specific named door, including its settings, permissions, and configuration data.
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return table doorData The full cached data of the specified door.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
endlocal data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)Get Door Data (By Unique ID)
Returns the full cached data of a specific door. The unique ID determines exactly which door’s data you want to retrieve. This allows you to access all stored information for a specific door, including its settings, permissions, and configuration data.
--- @param uniqueId string The unique ID of the door.
--- @return table doorData The full cached data of the specified door.
--- @example
local uniqueId = '1234-5678'
local data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
endlocal data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)Last updated
Was this helpful?

