Standalone
Agency-Doorlock
The smartest way to lock down your city. Agency-Doorlock turns any door into a secure, persistent lock with effortless in-game setup — aim at a door, press E, done (double doors auto-pair). Open via the [E] prompt or with ox_target / qb-target. Control access by job + grade, gang + grade, specific players, or leave it open to everyone. Locked doors physically stay shut (native door system), every lock state is saved to the database and synced to all players, and every action is validated server-side. Sleek glassmorphism setup UI, 25 languages, QBCore / QBox / ESX / Standalone — auto-detected.

01 Configuração
Complete config.lua for Agency-Doorlock. All options documented via inline comments.
-- ============================================================
-- Agency Doorlock | v1.0.0 - Config
-- ============================================================
-- Lockable doors with E & Target, easy in-game setup,
-- Job / Gang / Grade & per-player access control.
-- QB / QBox / ESX / Standalone auto-detect.
-- ============================================================
Config = {}
-- Language. Default is English. The script ships fully translated in 25 languages.
-- Add more by dropping a file into shared/locale/<code>.lua (English is the fallback).
-- Available: en de fr es it pt nl pl cs sk ro ru uk bg tr el hu hr sv da no fi ja zh ko
Config.Locale = 'en'
-- Framework: 'auto' | 'qb' | 'qbx' | 'esx' | 'standalone'
-- auto (recommended): detects QBox (qbx_core), QBCore, ESX automatically.
-- Job / Gang locks with grades are enforced on QBCore, QBox and ESX.
-- Standalone enforces "everyone" and per-player (identifier) access only.
Config.Framework = 'auto'
-- Notification system: 'agency-notify' | 'framework' | 'none'
-- agency-notify (default): https://shop.agencyg.de
-- framework: uses the QBCore / ESX built-in notification
Config.NotifySystem = 'agency-notify'
-- ============================================================
-- INTERACTION
-- ============================================================
-- How players toggle a lock: 'key' | 'target' | 'both'
-- key : press a key (Config.InteractKey) while standing at the door (uses Text UI)
-- target : ox_target / qb-target eye option
-- both : key prompt AND a target option (recommended)
Config.Interaction = 'both'
-- Key used when Interaction is 'key' or 'both' (default: E = 38)
Config.InteractKey = 38
Config.InteractKeyLabel = 'E' -- shown on the prompt keycap
-- Debug: prints access-check details to the server console (set false in production).
Config.Debug = false
-- Target system used when Interaction is 'target' or 'both': 'ox_target' | 'qb-target'
Config.TargetSystem = 'ox_target'
-- Text UI system for the [E] prompt: 'default' | 'jg-textui'
-- default : built-in 3D text drawn natively (no dependency)
-- jg-textui: https://github.com/jgscripts/jg-textui
Config.TextUISystem = 'default'
-- How close the player must be to interact with / see the prompt of a door.
Config.InteractDistance = 1.6
-- Global master switch for the [E] prompt HUD. Leave true normally — hiding the
-- prompt for SPECIFIC doors is done per-door in the setup UI ("Hide [E] prompt").
-- Auto-lock is also configured per-door in the setup UI.
Config.ShowPrompt = true
-- How close a door must be before the script starts drawing its prompt (perf).
Config.DrawDistance = 12.0
-- Auto-detect a second door leaf when registering (double doors). Disabled by
-- default — click each leaf you want instead. Set > 0 to re-enable auto-pairing.
Config.DoubleDoorDistance = 0
-- During setup a marker sits in front of you (where you look). Aim it at a door
-- and press [E]. Only door-shaped objects are accepted (see Config.DoorDetect).
Config.SetupRayDistance = 7.0 -- how far in front the selector reaches
-- Only allow door-like objects to be selected (not every prop). Doors are detected
-- by their shape: tall, fairly wide, but thin. Set false to allow ANY object.
Config.OnlyDoors = true
Config.DoorDetect = {
minHeight = 1.2, -- door must be at least this tall (m)
maxHeight = 5.0, -- ... and at most this tall (covers gates/garage doors)
maxThickness = 0.6, -- thinnest horizontal side must be <= this (doors are thin)
minWidth = 0.5, -- widest horizontal side range
maxWidth = 5.0,
}
-- Locking behaviour:
-- true (default): a locked door is always closed & locked (reliable).
-- false: a locked door that's open stays movable until it swings shut, then latches.
Config.LockClosesDoor = true
-- Play the native GTA door lock/unlock sound on toggle (heard by players near the door).
-- Loud, clearly audible GTA options (swap name/set as you like):
-- { name='Remote_Control_Fob', set='PI_Menu_Sounds' } -- GTA door/vehicle lock (loud) [default]
-- { name='Lock'/'Unlock', set='CELLPHONE_SOUNDSET' } -- subtle phone-lock click (quiet)
-- { name='SELECT', set='HUD_FRONTEND_DEFAULT_SOUNDSET' } -- menu beep
Config.PlaySound = true
-- Native sound DISABLED — the real door sound (html/door-bolt-4.ogg, same as qb-doorlock)
-- is played through the NUI. (Remote_Control_Fob was the car-key/fob beep — removed.)
Config.Sounds = {}
-- Lock / unlock animation played on the player who toggles the door.
-- A short forward hand-reach (works without a prop). Swap dict/name for any anim.
Config.Animation = {
enabled = true,
dict = 'anim@heists@keycard@',
name = 'exit',
duration = 1100, -- ms
}
-- ============================================================
-- SETUP / PERMISSIONS
-- ============================================================
-- Command to open the in-game door setup mode (aim at a door -> add -> configure).
Config.SetupCommand = 'adoorlock'
-- Short alias for the setup command (leave '' to disable). Default: /adl
Config.SetupCommandAlias = 'adl'
-- Who may open the setup mode and create / delete doors.
-- 'ace' : requires the ACE permission Config.SetupAce (server-sided, secure)
-- 'admin' : requires QBCore/ESX admin/god (or ace 'command' as fallback)
-- 'job' : requires one of the jobs in Config.SetupJobs
Config.SetupPermission = 'admin'
Config.SetupAce = 'agency.doorlock' -- used when SetupPermission == 'ace'
Config.SetupJobs = { ['mechanic'] = 0 } -- used when SetupPermission == 'job' (job = min grade)
-- ============================================================
-- VISUALS
-- ============================================================
Config.Colors = {
locked = { r = 255, g = 72, b = 72 }, -- red
unlocked = { r = 0, g = 255, b = 136 }, -- green
accent = { r = 0, g = 212, b = 255 }, -- cyan (setup highlight)
}
-- Marker shown on configured doors (the red/green dome). Helps players spot
-- lockable doors. Coloured red while locked, green while unlocked.
Config.Marker = {
enabled = false, -- no dots on doors (the nice [E] prompt shows when close)
type = 28, -- 28 = dome/half-sphere
distance = 12.0, -- draw the marker permanently within this range of a door
size = vec3(0.18, 0.18, 0.18), -- small & unobtrusive
alpha = 90,
bob = false,
onlyWhenLocked = false, -- true = only show the marker on locked doors
}
-- ============================================================
-- STATIC DOORS (optional)
-- ============================================================
-- Most doors should be created in-game with /doorlock (stored in the database).
-- You can ALSO predefine doors here; they are merged with the database doors.
-- Each leaf = { model = <hash>, coords = vec3(x, y, z) }
--
-- Example:
-- Config.StaticDoors = {
-- {
-- label = 'Police Cell 1',
-- locked = true,
-- doors = {
-- { model = `v_ilev_ph_cellgate`, coords = vec3(441.1, -998.6, 25.0) },
-- },
-- access = {
-- everyone = false,
-- jobs = { { name = 'police', grade = 0 } },
-- gangs = {},
-- players = {}, -- list of citizenids / identifiers
-- },
-- },
-- }
Config.StaticDoors = {}