Update door
Last updated
Citizen.CreateThread(function()
local doorId = 55
-- Example 1: Update only specific properties
local doorData = {
-- Update access permissions
allowedIdentifiers = {
["steam:1100001xxxxxxxx"] = true,
["license:xxxxxxxxxxxxxxx"] = true
},
allowedJobs = {
["police"] = {
["0"] = true,
["1"] = true,
["2"] = true
}
},
-- Update required item
requiredItem = "special_key",
-- Change lockpick settings
canBeLockpicked = true,
alertPoliceOnLockpick = true
}
local success = exports["doors_creator"]:updateDoor(doorId, doorData)
if success then
print("Door with ID " .. doorId .. " has been updated")
else
print("Failed to update door with ID " .. doorId)
end
-- Example 2: Complete door update
-- This would replace all properties of the door
local completeUpdate = {
label = "Updated Door",
defaultState = 0, -- Now unlocked by default
doors = {
{
model = 747286790,
coords = {
x = 152.7808,
y = -1000.5450,
z = 29.3962
}
}
},
maxDistance = 3.0, -- Increased interaction distance
iconCoords = {
x = 152.7808,
y = -1000.5450,
z = 29.3962
},
displayIcon = true,
isSliding = false,
parentBuilding = 2, -- Changed building association
requiresJobAndItem = false
}
-- exports["doors_creator"]:updateDoor(doorId, completeUpdate)
end)