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
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#
| Resource | Required | What for |
|---|---|---|
ox_lib | Required | Interface and shared helpers |
oxmysql | Required | Door storage — the table is created on first start |
ox_target | Optional | Otherwise aim and press E |
Installation#
- Drop
SF-Doorlockinto yourresourcesfolder. - Add the line below to your
server.cfg, after ox_lib, oxmysql and your framework. - Grant the admin permission:
add_ace group.admin sf-doorlock.admin allow. - Set
Config.Debug = falsebefore going live.
ensure ox_lib ensure oxmysql ensure SF-Doorlock
Configuration#
| Setting | Default | What it does |
|---|---|---|
Config.Marker | — | Padlock colours, size, distance, locked-only display |
Config.Key | E | The default key — each player can rebind it in FiveM settings |
Config.ShowLockedHint | true | The on-screen reminder when you approach |
Config.OpenAnim | — | Animation dictionaries, tried in order until one is available |
Config.Sound.files | — | Your own lock and unlock sounds, dropped in html/sounds/ |
Config.Debug | false | Enables /doorwhy and /doordebug |
Commands#
| Command | What 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 |
/lockpickdoor | Lockpick 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#
exports['SF-Doorlock']:IsDoorLocked(doorId) --> boolean exports['SF-Doorlock']:SetDoorState(doorId, bool) --> force the state exports['SF-Doorlock']:GetDoors() --> every door