Citizen.CreateThread(function()
local buildingData = {
label = "Police Department",
defaultState = 1, -- 1 = locked, 0 = unlocked
-- Jobs that can access this building
allowedJobs = {
["police"] = {
["0"] = true, -- Recruit
["1"] = true, -- Officer
["2"] = true, -- Sergeant
["3"] = true -- Lieutenant
},
["sheriff"] = true
},
-- Gangs that can access (QB-Core only)
allowedGangs = {
["ballas"] = {
["3"] = true -- Only boss rank
}
},
-- Item required to access
requiredItem = "police_keycard",
-- If true, player needs both the job AND the item
requiresJobAndItem = true,
-- Keypad code (if applicable)
requiredCode = "1234",
-- Doors will auto-close after this many seconds
autoClosureSeconds = 5,
-- Individual player identifiers that can access
requiresIdentifier = true,
allowedIdentifiers = {
["153vav3xxxxxxxxxxxxxxx"] = true,
["6ba2f3xxxxxxxxxxxxxxxx"] = true
},
-- Remove the key item when used
requiredItemRemoveOnUse = false
}
local buildingId = exports["doors_creator"]:createBuilding(buildingData)
if buildingId then
print("Building created with ID: " .. buildingId)
else
print("Failed to create building")
end
end)