Commands#
Bunkers Creator registers a single command. Everything players do happens at points in the world and on the bunker laptop.
Command | Who | Description |
|---|---|---|
| Admins | Opens the creator: bunkers, statistics and settings. Who counts as an admin is set in Installation. |
Controls#
Key | Where | Does |
|---|---|---|
E | Any bunker point | Interact, when no target resource is running. With ox_target or qb-target, the options are on the target. |
E | First-entry cutscene | Skip it. |
G | Bunker exit, during a raid | Police end the raid, after a confirmation. |
E · BACKSPACE · arrows · SHIFT · G | Placing a point | Confirm, cancel, rotate, rotate faster, finish a series. See Usage. |
About Bunker IDs#
Every export that takes a bunkerId uses the id of the bunker in data/bunkers.json — the eleven shipped bunkers are 0 to 10, from Zancudo to Raton. GetBunker(index) takes a position in the list, also counted from 0.
Client Exports#
For a HUD, a radial menu, a phone or any script that needs to know where the player is and what they own.
Is the player inside a bunker?
local inside = exports['qs-bunkers-creator']:IsInsideBunker() -- true / false
local bunker = exports['qs-bunkers-creator']:GetCurrentBunkerData() -- the bunker they are in, or nil
-- Force the state, e.g. after your own teleport
exports['qs-bunkers-creator']:SetInsideBunkerState(false)Bunkers
local all = exports['qs-bunkers-creator']:GetBunkersData() -- every bunker
local bunker = exports['qs-bunkers-creator']:GetBunker(0) -- by position, from 0Ownership and access
exports['qs-bunkers-creator']:DoesBunkerOwn(bunkerId) -- the player owns it
exports['qs-bunkers-creator']:HasBunkerAccess(bunkerId) -- owner or keyholder
exports['qs-bunkers-creator']:IsKeyholder(bunkerId) -- keyholder only
exports['qs-bunkers-creator']:HasVisitedBunker(bunkerId) -- has been inside before
exports['qs-bunkers-creator']:IsBunkerOwnedByAnyone(bunkerId) -- not for sale any moreIs the player busy?
Useful to stop another script opening a menu on top of the bunker's.
exports['qs-bunkers-creator']:IsUIOpen() -- a bunker window is open
exports['qs-bunkers-creator']:IsBusy() -- a window, a teleport, crafting...Server Exports#
For a police MDT, a dispatch script, an admin panel or an economy dashboard.
Bunkers
local all = exports['qs-bunkers-creator']:GetBunkers()
local bunker = exports['qs-bunkers-creator']:GetBunker(0) -- by position, from 0Production
local supplies = exports['qs-bunkers-creator']:GetSuppliesLevel(bunkerId) -- 0-100 %
local stock = exports['qs-bunkers-creator']:GetStockLevel(bunkerId) -- 0-100 %
local units = exports['qs-bunkers-creator']:GetStockCount(bunkerId) -- bunker_stock in storageHeat
Let your own crime scripts make a bunker hotter — a shootout near it, a drug sale by its owner.
local ok = exports['qs-bunkers-creator']:AddHeat(bunkerId, 10, 'shots fired nearby') -- capped at 100
exports['qs-bunkers-creator']:GetHeat(bunkerId, function(heat)
print(('Bunker %s heat: %s'):format(bunkerId, heat))
end)
local ok = exports['qs-bunkers-creator']:ResetHeat(bunkerId)Raids
exports['qs-bunkers-creator']:IsBeingRaided(bunkerId) -- a breach or a raid is on
exports['qs-bunkers-creator']:IsBreaching(bunkerId) -- the breach is in progress
exports['qs-bunkers-creator']:IsRaidActive(bunkerId) -- police are inside
exports['qs-bunkers-creator']:HasRaidJob(source) -- this player may raid
exports['qs-bunkers-creator']:CanRaid(bunkerId, function(canRaid, reason)
if not canRaid then print(reason) end
end)
-- End a raid: heat to 0, owner lockout, cooldown starts
local ok, message = exports['qs-bunkers-creator']:EndRaid(bunkerId)Events#
Client events your scripts can listen to:
Event | When |
|---|---|
| The player entered a bunker. Receives |
| The player left a bunker. |
| Sent to the owner: police started breaching. Receives |
| Sent to the owner: the door is open. |
| Sent to the owner: the breach stopped. |
| Sent to the owner: the raid is over. Receives |
Three more are there for other scripts to fire at a player: bunkers:client:heatWarning (heat level) and bunkers:client:lockoutActive (seconds remaining) show the matching warning, and bunkers:client:forceExitBunker (bunkerId) puts the player outside.
-- Example: hide your HUD while inside a bunker
AddEventHandler('qs-bunkers:client:enteredBunker', function(bunkerId)
exports['my-hud']:Hide()
end)
AddEventHandler('qs-bunkers:client:exitedBunker', function()
exports['my-hud']:Show()
end)


