QBCore Frameworkqbcore.netCommunity docs
On this page

Updated 2026-09-21 · 5 min read

qb-doorlock

qb-doorlock manages lock states for GTA door entities. Its setup has two independent parts: identifying the actual door in your installed map and defining who may operate it. A visible prompt proves neither that the model is correct nor that the intended access policy is enforced.

Baseline: a019531f. The README lists qb-core, qb-input for door creation and qb-minigames for lockpicking. The manifest loads global configuration and configs/*.lua definitions.

Set up a FiveM door lock

Load the actual map/MLO and required resources on staging. Check startup errors first. Use Pleb Masters Forge to research a model, but obtain placement and heading from the installed entity, not a catalog screenshot.

Use /newdoor with an account allowed by Config.CommandPermission, then review the generated definition. /doordebug is the documented debugging command. Creation permissions are not the same as permissions to open an existing door; the upstream command/config reference describes those commands.

Before committing a generated door, inspect:

ValueWhat must match your server
Definition key/door IDUnique, stable ID used by dependent resources
Model and coordinatesThe actual door entity in this map revision
HeadingThe door's intended closed orientation
Single or double typeWhether one or two entities make up the opening
Interaction distance/text positionReachable from the intended side without excessive range
lockedDeliberate initial/default lock state
Authorization fieldsYour intended access paths, without copied unrelated entries

For a double door, capture both leaves. Keep only one controller for the same physical door. Do not overwrite existing bank-door IDs: qb-bankrobbery can depend on their order or identifiers.

Configuration and authorization

The pinned server authorization function returns as soon as an allowed path succeeds. Job, gang, citizen ID and item access are alternatives, not an automatic combined requirement. Adding an item field does not make an already-authorized job require that item too.

For a generated door intended to allow police grade 2 and above, the relevant field is:

authorizedJobs = { ['police'] = 2 },

This is a field inside the existing generated definition, not a standalone resource. Remove unintended copied authorizedGangs, authorizedCitizenIDs or items paths when implementing a job-only policy. Also review allAuthorized, lockpicking and global administrative access.

SettingMeaning at this baseline
Config.CommandPermissionPermission for creating doors
Config.AdminAccess / Config.AdminPermissionSeparate optional administrative operating access
authorizedJobs = { ['police'] = 2 }Matching internal job with minimum grade 2
authorizedCitizenIDsAnother identity-based operating path
needsAllItemsCombines checks inside item access; does not combine items with a job rule
allAuthorizedBroad access path that must not be enabled accidentally

Do not interpret client-side prompt visibility as a server audit. Review the complete handler and your installed modifications before relying on a restriction. A more complex policy, such as job and item, needs a deliberately reviewed server-side implementation rather than a copied table with both fields present.

Persistent state is not the default state

The config exposes Config.PersistentDoorStates. The server saves states to saves/doorstates.json and reloads matching IDs. A persisted state can therefore supersede the default locked value when persistence is enabled.

The setting is spelled Config.PersistentSaveInternal at this baseline; do not silently rename it to a more natural-looking Interval key. Its config comment expresses the interval in milliseconds. Check the consumer and storage errors before changing timing or deleting saved states.

To diagnose a restart mismatch, record the door ID, configured default, persistence setting and stored state. Work on a staging copy. Deleting a whole state file is not a targeted fix for one door and can affect every saved door.

Troubleshooting doors that will not lock

SymptomInspect firstDistinguishing test
No promptLoaded definition, distance, map startup and modelInspect the installed entity with debugging enabled
Prompt toggles but door still movesModel/coordinates, door type and competing controllerTest one definition without overlapping controllers
Only one leaf behaves correctlyBoth entities and their headingsInspect each leaf, not just the center text
Intended police grade is deniedCurrent internal job and numeric gradeTest just below and at the configured grade
Unrelated player can open itAlternative authorization pathsReview each allow path, not only authorizedJobs
State differs after restartPersistence and saved IDCompare default state with the saved value
Door-creation form does not appearqb-input startup and client errorsTest qb-input independently

Turn debug output off after diagnosis. Do not enable global admin access as a fix for a misconfigured job or inaccessible prompt.

Update checklist

Use separate staging characters for the permitted grade, a lower grade and an unrelated job. Check both sides of the door, each double-door leaf, lock/unlock, reconnect and a controlled restart. Review robbery scripts before changing any shared door IDs.

Save the code/config diff and prior state file before a persistence experiment. Roll back the specific definition and its intended state, not unrelated player or inventory records. The acceptance matrix is an instruction to test, not a report of completed FiveM runtime tests or proof that every upstream handler is secure.

Continue with safe updates, server authority or resource references.

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website