📄
jaksam's scripts documentation
  • 💻jaksam's scripts
    • Home
    • How to update the scripts
    • Fix server crash on script start
    • Issues with items
    • Manually set ESX shared object
    • Common FAQ
    • Nexus Terms
    • LICENSE
  • ⚠️FiveM escrow system errors
    • Home
    • Error parsing script ... <\1>
    • Failed to verify protected resource
    • You lack the required entitlement
    • What to do if nothing is fixing the errors
  • 💼Jobs Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • Replacing default scripts names
    • Replacing default events names
    • Updating script from old versions
    • QBCore Jobs Injection
    • Client
      • Notifications
        • Replace default notifications
        • Replace help notification/TextUI
      • Actions
        • Using the actions in a radial/external menu
        • Replace default search action
        • Get player allowed actions
        • Open actions menu
        • Integrate external impound script
        • Vehicle repaired
        • Get if local player is handcuffed
      • Duty
        • Duty status toggled
        • Toggle current duty status
      • Buyable vehicles
        • Vehicle spawned
        • Vehicle parked
      • Garage owned
        • Vehicle spawned
        • Vehicle parked
      • Temporary garage
        • Vehicle spawned
        • Vehicle parked
      • Replace Stash/Safe/Armory
      • Replace default billing
      • Progress bar
    • Server
      • Armory
        • Add weapon to armory
        • Remove weapon from armory
        • Get player armory weapons
        • Get all armory weapons
      • Boss
        • Add society account money
        • Remove society account money
        • Get job account money
        • On player fired
        • On player hired
      • Buyable vehicles
        • Get if player is owner of vehicle plate
        • Get all vehicles of player
        • On vehicle bought
        • Get player vehicles in marker ID
      • Crafting table
        • Item crafted
      • Duty
        • Duty status changed
        • Get if a player is on duty
      • Harvest
        • Item harvested
      • Market
        • Item sold
      • Process
        • Item processed
      • Shop
        • Item bought
      • Search/Steal action
        • Item stolen
        • Account stolen
        • Weapon stolen
      • Set handcuffs state
  • 💰Robberies Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • How to edit minigames
    • Client
      • Progress bar
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
    • Server
      • Heist started
      • Heist finished
      • Police alerted
      • Step completed
  • 💡Missions Creator
    • Home
    • Installation
    • How to start
    • How to add minigames
    • Client
      • Replace default police alert
      • On entity spawn
      • Notifications
        • Replace default notifications
        • Replace default help notifications
        • Replace default mugshot notifications
    • Server
      • Police alerted
      • On mission start
      • On mission failed
      • On mission success
  • 🛒Shops Creator
    • Home
    • Installation
    • How to use images for items
    • Client
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
    • Server
      • Police alerted
      • Shop bought
      • Shop sold
      • Get what objects can be sold in shop ID
      • Get objects in shop ID
  • 🚗Dealerships Creator
    • Home
    • Installation
    • Adding custom vehicles/classes
    • Client
      • On test drive vehicle spawn
      • Notifications
        • Replace default notifications
        • Replace default help notifications
      • Showroom
        • On showroom enter
        • On showroom exit
        • Get Is Player In Showroom
        • Get Is Player Doing Test Drive
    • Server
      • On vehicle given
      • On vehicle resell
  • 🏁Races Creator
    • Home
    • Installation
    • Client
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
    • Server
      • Police alerted
  • 📍Blips Creator
    • Home
    • Installation
    • FAQ
    • How to use custom sprites
    • Client
      • Open menu manually
  • 🚪Doors Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • Change doors icon
    • Admin bypass lock
    • Client
      • Replace default notifications
      • Get closest door
      • Toggle icon display
      • Replace default police alert
      • Get door ID from entity
    • Server
      • Refresh database
      • Police alerted
      • Get door ID data
      • Get building ID data
      • Get all buildings list
      • Get all doors list
      • Set door ID state (locked/unlocked)
      • Lockpicked door
      • Create building
      • Create door
      • Delete door
      • Update door
  • 💊Drugs Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • Client
      • Replace default notifications
      • Progress bar
      • Replace default mugshot notifications
      • Replace default help notifications
      • Replace default police alert
      • Manually start drugs effects
      • NPC Selling
        • Disable default selling method for NPCs
        • Add ped to selling blacklist
        • Remove ped from selling blacklist
        • Manually sell to a NPC
        • NPC accepted drug
    • Server
      • Fields
        • Item harvested
      • Harvestable items
        • Item harvested
      • Laboratories
        • Successful craft
      • Sellings
        • Sold to pusher
        • Sold in boat
        • Sold in plane
        • Sold to NPC
        • Sold to narcos
      • Police alerted
      • Pocket crafting finished
  • 🚜Farming Creator
    • Home
    • Installation
    • Client
      • Replace default notifications
      • Progress bar
      • Replace default help notifications
      • Replace default police alert
    • Server
      • Police alerted
      • Item farmed
  • 🛰️Trackers Creator
    • Home
    • Installation
    • FAQ
    • Optimization
    • Client
      • Replace default notifications
      • Panic button pressed
      • Manually start panic button
    • Server
      • Panic button pressed
      • Player lost signal
      • Player set new private frequency
  • 🔑Vehicles Keys
    • Home
    • Installation
    • FAQ
    • How to give keys with /car command
    • Fix hotwiring bought car
    • Lock/unlock vehicle
    • Client
      • Self give current vehicle plate
      • Self give vehicle plate
      • Self remove vehicle plate
      • Open remote UI menu
      • Open keys list
      • Toggle hotwiring
      • Get if local player owns a plate
      • Get owned plates of local player
      • Toggle closest vehicle lock
      • Switch vehicle lock
      • Vehicle locked/unlocked
      • Replace/Disable default progress bar
      • Refresh self owned vehicles
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
      • Bypass start vehicle check
    • Server
      • Refresh player owned vehicles
      • Get if player ID owns a plate
      • Vehicle locked/unlocked
      • Player hotwired a vehicle
      • Player lockpicked a vehicle
      • Give keys to identifier
      • Remove keys from identifier
      • Give keys to player ID
      • Remove keys from player ID
      • Vehicle window broken
      • Get player ID keys
      • Get identifier keys
      • Police alerted
      • Alarms
        • Alarm activated (player vehicle)
        • Alarm activated (NPC vehicle)
  • 🧾Billing UI
    • Home
    • Installation
    • Client
      • Activate billing mode
      • Open billing menu
      • Replace default notifications
      • Pay a bill
      • Send a bill
      • View invoices
    • Server
      • Create bill
      • Delete bill
      • Refresh bill
      • On bill created
      • On bill paid
  • ✅Easy allowlist
    • Home
    • Installation
    • FAQ
    • Commands usage
    • How to enable Discord features
    • External deferrals
    • Server
      • Allowlist
        • Remove identifier from allowlist
        • Add identifier to allowlist
      • Queue
        • Set player queue priority
        • Set discord role queue priority
        • Set identifier queue priority
        • Remove identifier queue priority
        • Remove discord role queue priority
        • Get count of players currently in queue
        • Get queue info
  • 👜Luxury Clothes Theft
    • Home
    • Installation
    • Client
      • Replace default notifications
Powered by GitBook
On this page
  • Export
  • Parameters
  • doorData Format
  • Returns
  • Example

Was this helpful?

  1. Doors Creator
  2. Server

Update door

Export

exports["doors_creator"]:updateDoor(doorId, doorData)

Parameters

Name
Data Type
Description

doorId

integer

The ID of the door to update

doorData

table

The door data to update with

doorData Format

This parameter can contain any of the fields used in AddDoor. You can provide only the fields you want to update, as the function will preserve existing values for fields not specified.

Field
Data Type
Description

label

string

Name of the door

defaultState

integer

Default state: 1 = locked, 0 = unlocked

doors

table

Array of door objects with model and coordinates

maxDistance

number

Maximum distance for interaction

iconCoords

table

Coordinates where to show the interaction icon

allowedJobs

table

Table of jobs allowed to access, with grades

allowedGangs

table

Table of gangs allowed to access, with grades

requiredItem

string

Item required to access

requiresJobAndItem

boolean

If true, both job and item are required

requiredCode

string

Code required to access

autoClosureSeconds

integer

Seconds after which doors auto-close

parentBuilding

integer

Building ID this door belongs to

isSliding

boolean

If true, door is sliding rather than hinged

displayIcon

boolean

Whether to display interaction icon

requiresIdentifier

boolean

If true, specific identifiers are allowed

allowedIdentifiers

table

Table of identifiers allowed to access

vault

table

Vault door configuration

canBeLockpicked

boolean

If true, door can be lockpicked

alertPoliceOnLockpick

boolean

If true, police is alerted when door is lockpicked

soundsData

table

Custom sounds configuration

requiredItemRemoveOnUse

boolean

If true, the required item will be removed on use

Returns

Data Type
Description

boolean

True if the door was updated, false otherwise

Example

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) 
PreviousDelete doorNextHome

Last updated 25 days ago

Was this helpful?

🚪