2025-05-09 02:01:37 -04:00
|
|
|
---@diagnostic disable: duplicate-set-field
|
2025-05-18 23:45:37 -04:00
|
|
|
if GetResourceState('ox_doorlock') == 'missing' then return end
|
2025-01-10 16:36:20 -05:00
|
|
|
|
|
|
|
|
Doorlock = Doorlock or {}
|
|
|
|
|
|
2025-04-19 14:37:10 -04:00
|
|
|
---This will toggle the lock status of the door.
|
2025-08-21 05:37:44 -04:00
|
|
|
---@param doorID string|number
|
2025-04-19 14:37:10 -04:00
|
|
|
---@param toggle boolean
|
|
|
|
|
---@return boolean
|
2025-01-10 16:36:20 -05:00
|
|
|
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
2025-08-21 05:37:44 -04:00
|
|
|
if type(doorID) == 'string' then
|
|
|
|
|
doorID = tonumber(doorID)
|
|
|
|
|
end
|
2025-01-10 16:36:20 -05:00
|
|
|
local state = toggle
|
|
|
|
|
if state then
|
|
|
|
|
exports.ox_doorlock:setDoorState(doorID, 1)
|
|
|
|
|
else
|
|
|
|
|
exports.ox_doorlock:setDoorState(doorID, 0)
|
|
|
|
|
end
|
|
|
|
|
return true
|
2025-05-10 00:01:56 -04:00
|
|
|
end
|
|
|
|
|
|
2025-09-10 12:27:12 -04:00
|
|
|
---This will get the name of the in use resource.
|
|
|
|
|
---@return string
|
|
|
|
|
Doorlock.GetResourceName = function()
|
|
|
|
|
return 'ox_doorlock'
|
|
|
|
|
end
|
|
|
|
|
|
2025-05-10 00:01:56 -04:00
|
|
|
return Doorlock
|