Files

29 lines
726 B
Lua
Raw Permalink Normal View History

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
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
Doorlock.ToggleDoorLock = function(doorID, toggle)
2025-08-21 05:37:44 -04:00
if type(doorID) == 'string' then
doorID = tonumber(doorID)
end
local state = toggle
if state then
exports.ox_doorlock:setDoorState(doorID, 1)
else
exports.ox_doorlock:setDoorState(doorID, 0)
end
return true
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
return Doorlock