Moderation

Door Lock System

Lockable doors configured entirely in game — aim at a door, type a command — with job, gang or key access, double doors and auto-relock.

Version
1.7.5
Resource
SF-Doorlock
Version 1.7.5 Resource SF-Doorlock Frameworks ESX · QBCore · QBX · Standalone Bundled languages 5 Store page View

Overview#

Configured in game

No file to open. /adddoor starts selection immediately, you click the leaf, you fill the form.

Double doors

The second leaf is never guessed — you point at it. GTA doors use two different models too often for a heuristic to hold.

Garages and gates

The leaf is measured on creation. Past 2.5 m the script offers to move it itself, since a shutter cannot be pushed by hand.

Access by job, gang or item

Any combination. The Gangs field is greyed out on ESX and standalone, which have no gangs.

A visible padlock

Red and closed, green and open, drawn in DUI up to 10 m. Nothing to stream on the player side.

Reaching for the handle

The character extends an arm before the leaf moves — upper body only, so control is never taken away.

Audible lock

The click carries 18 m to everyone around, quieter with distance. Synthesised by default, replaceable with your own files.

Exports

Read and force any door state from a heist or lockpicking script.

Dependencies#

ResourceRequiredWhat for
ox_libRequiredInterface and shared helpers
oxmysqlRequiredDoor storage — the table is created on first start
ox_targetOptionalOtherwise aim and press E

Installation#

  1. Drop SF-Doorlock into your resources folder.
  2. Add the line below to your server.cfg, after ox_lib, oxmysql and your framework.
  3. Grant the admin permission: add_ace group.admin sf-doorlock.admin allow.
  4. Set Config.Debug = false before going live.
server.cfg
ensure ox_lib
ensure oxmysql
ensure SF-Doorlock

Configuration#

SettingDefaultWhat it does
Config.MarkerPadlock colours, size, distance, locked-only display
Config.KeyEThe default key — each player can rebind it in FiveM settings
Config.ShowLockedHinttrueThe on-screen reminder when you approach
Config.OpenAnimAnimation dictionaries, tried in order until one is available
Config.Sound.filesYour own lock and unlock sounds, dropped in html/sounds/
Config.DebugfalseEnables /doorwhy and /doordebug

Commands#

CommandWhat it does
/adddoor(admin) Add the door you are looking at
/removedoor(admin) Remove the nearest door
/doorlist(admin) The door manager: edit, lock, delete, GPS
/lockpickdoorLockpick the nearest door, or use the item
/sf_doors_debug(console) Bridges and loaded doors
/doorwhy(Config.Debug) Why this door opens, or does not
/doordebug(Config.Debug) What the door system knows about it

Exports#

server
exports['SF-Doorlock']:IsDoorLocked(doorId)        --> boolean
exports['SF-Doorlock']:SetDoorState(doorId, bool)  --> force the state
exports['SF-Doorlock']:GetDoors()                  --> every door

Good to know#

Door state lives in the database and is held by the server, which re-checks the job, the gang, the items and the distance on every change. A client cannot open a door it has no access to.
Position and models cannot be edited after creation. To move a door, delete it and create it again — everything else stays editable.
A door saved before the sliding option existed can be upgraded: /doorlist, then edit, then tick Sliding door / garage.
Opening speed only applies to sliding doors, the only ones the script moves itself. A hinged door is pushed by hand once unlocked, exactly as in the base game.