House Zones
House zones are gang headquarters — secure buildings with locked doors and storage that only the owning organization can access. When a gang captures or is assigned a house zone, their members automatically get access to all linked doors and storages inside.
This system integrates with ox_doorlock or qb-doorlock — whichever your server runs. No config needed, it auto-detects.
How It Works
1. Admin Sets Up Doors
Use your doorlock resource (/doorlock or /newdoor) to create doors on the MLO as usual.
2. Link Doors to Zone
Use /criminal linkdoor to connect door IDs to a house zone. That's it.
3. Auto-Sync
Core Gangs handles the rest. Ownership changes, member joins/leaves — door access updates automatically.
KEY CONCEPT
You set up doors once. Core Gangs dynamically manages who can open them based on zone ownership. When a gang loses the zone in a war, they lose door access instantly — the new owners get it.
Setup Guide
1
Create doors on the MLO
Use your doorlock resource to set up doors on the house MLO like you normally would.
ox_doorlock:
/doorlockqb-doorlock:
/newdoorSet up each door on the MLO — front door, back door, storage room, whatever you need. Don't set any jobs, gangs, or citizen IDs on the doors — Core Gangs will manage access automatically.
IMPORTANT
Leave the door's access fields empty (no authorized jobs, gangs, or citizen IDs). Core Gangs overwrites the characters field (ox_doorlock) or authorizedCitizenIDs field (qb-doorlock) whenever access is synced. Any manually set values will be replaced.
2
Find your IDs
Zone ID — Stand in the house zone and type:
/criminal zoneCheck the F8 console for the zone ID.
Door IDs:
- ox_doorlock — Door IDs are numbers. Check your
ox_doorlockdatabase table or the F8 console output when creating a door. - qb-doorlock — Door IDs are usually strings like
'configname-dooridentifier'or numbers. Check your qb-doorlock config files.
3
Link doors to the zone
Use the admin command to connect each door to the house zone:
/criminal linkdoor <zoneId> <doorId>Examples:
lua
-- ox_doorlock (numeric IDs)
/criminal linkdoor 7067 1
/criminal linkdoor 7067 2
/criminal linkdoor 7067 3
-- qb-doorlock (string IDs)
/criminal linkdoor 7067 ballas-frontdoor
/criminal linkdoor 7067 ballas-backdoorYou can link as many doors as you want to a single zone. Each door ID is stored in the database — it persists across restarts.
To check which doors are linked:
/criminal zonedoors 7067To remove a door:
/criminal unlinkdoor 7067 24
Assign ownership
Either assign the zone to an org manually:
/criminal setzone 7067 ballasOr let gangs capture it through the war system (if HouseZoneCapture = true).
Once an org owns the zone, all their members can open the linked doors. That's it — fully automatic from here.
When Does Access Update?
Access is re-synced automatically whenever any of these happen:
| Event | What happens |
|---|---|
| Zone captured in war | Old gang loses access, winning gang gets access |
Admin assigns zone (/criminal setzone) | New org members get access |
Admin resets zone (/criminal resetzone) | All access removed |
| Player joins org (invite code or direct invite) | Player gets access to all org house zone doors |
| Player leaves org | Player loses access |
| Player kicked from org | Player loses access |
| Org deleted | All access removed from all org zones |
| Server restart | All house zone doors re-synced on startup |
Commands
admin
/criminal linkdoorqb-coreesx
Link a doorlock door to a house zone. The owning organization's members will get access.
| Argument | Type | Description |
|---|---|---|
zoneId | | House zone ID (from /criminal zone) |
doorId | | Door ID from ox_doorlock (number) or qb-doorlock (string/number) |
Usage
lua
/criminal linkdoor 7067 1
/criminal linkdoor 7067 ballas-frontdooradmin
/criminal unlinkdoorqb-coreesx
Remove a door from a house zone. The door's access list will be cleared.
| Argument | Type | Description |
|---|---|---|
zoneId | | House zone ID |
doorId | | Door ID to unlink |
Usage
lua
/criminal unlinkdoor 7067 1admin
/criminal zonedoorsqb-coreesx
List all doors currently linked to a house zone.
| Argument | Type | Description |
|---|---|---|
zoneId | | House zone ID |
Usage
lua
/criminal zonedoors 7067Required Code for qb-doorlock
If you're using qb-doorlock, you need to add two exports to its server file so Core Gangs can manage door access. Open qb-doorlock/server/main.lua and paste this at the very bottom:
lua
-- Exports for external resources (e.g. core_gangs doorlock integration)
exports('getDoor', function(doorID)
local door = Config.DoorList[doorID]
if not door then return false end
return door
end)
exports('editDoor', function(doorID, data)
local door = Config.DoorList[doorID]
if not door then return end
for k, v in pairs(data) do
door[k] = v
end
end)ox_doorlock
If you're using ox_doorlock, no extra code is needed — it already has the exports Core Gangs uses (getDoor, editDoor).
Exports
These exports let other resources interact with the house zone door system:
server
exports['core_gangs']:linkDoorToZone(zoneId, doorId)Link a doorlock door to a house zone programmatically.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | House zone ID |
doorId | number|string | Door ID from your doorlock resource |
Returns:
booleanExample
lua
exports['core_gangs']:linkDoorToZone(7067, 1)server
exports['core_gangs']:unlinkDoorFromZone(zoneId, doorId)Remove a door from a house zone.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | House zone ID |
doorId | number|string | Door ID to unlink |
Returns:
booleanExample
lua
exports['core_gangs']:unlinkDoorFromZone(7067, 1)server
exports['core_gangs']:updateZoneDoorAccess(zoneId)Force re-sync door access for a specific house zone. Useful if you modify org membership externally.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | House zone ID |
Returns:
nilExample
lua
exports['core_gangs']:updateZoneDoorAccess(7067)server
exports['core_gangs']:updateOrgDoorAccess(orgName)Force re-sync door access for ALL house zones owned by an organization.
| Parameter | Type | Description |
|---|---|---|
orgName | string | Organization name |
Returns:
nilExample
lua
exports['core_gangs']:updateOrgDoorAccess('ballas')