Jobs
Doors/props, legal and illegal activity jobs, heists, and a unified admin panel for Qbox + ox_inventory. Occupations and society vaults go through GR1M_UltraBoss (GR1M) when that resource is running.
This is a first-party replacement for jaksam doors_creator / robberies_creator. Do not lock the same world doors from both systems.
#Requirements
oxmysql,ox_lib,qbx_core,ox_inventory- Optional:
ox_target(per-door Ox Lib lock icon + E if missing) - Optional:
op-crime(gang-owned doors; those doors fail closed if it is stopped) - Optional:
GR1M_UltraBoss(occupation create + society payouts) - Optional:
ox_doorlock(setoxDoorlockIdon a door to mirror lock state) - Optional:
kartik-mdt(heist alerts)
#Install
- Folder must be named
GR1M_Jobs. - Schema auto-creates on first boot (or import
sql/install.sql). - Lua files under
config/are seed only. After the matching MySQL table has rows, the database is the source of truth. - Apply
server.cfg.snippet.
add_ace group.admin gr1mjobs.admin allow
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure ox_target
ensure GR1M_UltraBoss
ensure GR1M_Jobs
Example seed items (sandwich, lockpick, goldchain, security_card) must exist in ox_inventory or the related reward/access checks fail closed.
#Admin
/gr1mjobs (alias /gjadmin) — qbx admin/god, or ACE gr1mjobs.admin. The ACE command shortcut is no longer accepted by default — see Permissions wiring.
Creating a new Qbox occupation from the Jobs tab still requires GR1M admin (UBAdmin.CanUse), because it calls exports.GR1M_UltraBoss:SaveJob.
Tabs:
- Doors — a top-down world map plus a buildings/doors tree. See Doors map. Capture look-at entity, my position, teleport, toggle lock, CRUD. Native doors only (
AddDoorToSystem). Job/heist props are not listed here. - Jobs — activity missions (not occupations). NEW opens a two-step wizard: pick a
template (simple run, pickup and delivery, multi-stop route, locked site) or Blank, then name it and set legal/illegal and crew size. The start is placed where you stand and you land on the board with the Problems panel open. Bind
requiredJobto an existing UltraBoss/Qbox job, or check Create UltraBoss occupation on save (one-shot: the flag clears after the occupation is created). Optional work vehicle + keys for the duration of the run.interact_propstages Place / Remove spawned props (not map furniture). - Heists — opens on SETUP: one page with a checklist, Basics, How they get in
(Walk in, Lockpick, Keypad hack, Keycard, Planted item), What they steal (each loot point and safe has its own loot table), Cops and cooldowns, and Add-ons (time limit, guards, alarm, extra hack, lasers, escape point, getaway car). LOCATIONS places the heist at as many spots as you like; BOARD is the full step board for branches and cinema, and always stays in sync. NEW asks how the crew gets in, or Custom for the board. See Heist Setup.
- Scenes — reusable world scenes (props/peds) referenced by jobs and heists.
- Muggings — NPC mugging profiles. Players aim a weapon at a ped and hold it; the
first enabled profile (lowest priority) that fits the ped decides who can be robbed (gender, only/never ped models, optional area, street peds only), how (weapon rule, aim time, distance, fight / run chances) and what it pays (cash range, item rolls, cooldown, heat, police alert chance and jobs). The server re-checks every rule and rolls the victim's reaction. Zombies (GR1M_Zombies
gr1mZombieIdstate bag or a model inGJConfig.Muggings.ZombieModels), players, dead peds and job NPCs are never muggable. Astreet_muggingprofile is seeded on first boot. Settings has an NPC muggings toggle for the whole module. - Sites — search spot, mine, oil well, concrete plant, drum / tank, unload / refine. Each kind shows a plain-language card and only the fields it uses. An Unload / refine site pours a crude
fluid_druminto empty oil bottles (default 1 L + 1empty_oil_bottle→ 1engine_oil; the empty drum stays). - Storage — stashes (none / key item / lockpick locks, job access, hide-when-empty).
- Settings — module toggles, ox_target vs marker, cooldowns, dispatch, heat.
- Stats — completed job/heist run log (success rate, duration, recent rows).
The STATE chip shows Saved / Unsaved / Error. Closing, switching tab or entry, or NEW with unsaved changes asks first. Ctrl+S saves, Ctrl+Z / Ctrl+Y undo and redo graph edits (80 steps), and deleting a step can be undone. The Problems panel lists every validation issue in plain words; click one to jump to the step and field. Save is refused while a blocking problem remains. Inputs carry the server's clamps as min/max.
#Authoring
- DUPLICATE copies the selected node and splices it in after the original, keeping
the rest of the flow attached.
- TEST RUN (on the start node) teleports you to the start and launches the flow
immediately, ignoring cooldowns. There was previously no way to trigger a job or heist from the panel at all.
- Reward items, heist required items and loot rows are repeating lists. They used
to be single fields, so a definition carrying more than one lost the rest the first time an admin opened and saved it.
- Loot pools are named, and a heist can hold several — add another LOOT POOL node
and set its name. Only
registerused to be editable, even though a loot spot could point at any pool by free text. - Inserting a stage mid-chain keeps the rest of the flow. It used to unlink the tail
and never reattach it, so everything past the insertion point was silently dropped on the next save — with validation still reporting OK.
- Dialogue on the start node (jobs and heists) is optional. When on, interacting
shows a talk card before the run starts. Accept / Decline buttons are optional; with no Accept button a Continue control starts the run. Decline, ESC, and walking away never start it. Branching conversations still belong in GR1M_Story.
- VALIDATE separates errors from warnings. Structural problems (fork, cycle, no
stages) block the save in the panel; missing positions are warnings, because a half-built flow is a legitimate thing to save. The server independently rejects a linear definition that could never be completed — no start position, or a
goto/wait/require_item/deliver_itemstage with nowhere to stand, or a heist escape with no position — and a graph with nostartnode or an unknown node type. A graph stage with nowhere to stand is caught at run time instead (the step simply never gates open), not at save.
#Graph authoring (schemaVersion 2)
Jobs and heists share one graph language. The NUI is a near-fullscreen workspace: left module list + node library, canvas, right inspector, bottom validation bar.
- Saves persist
schemaVersion: 2and the fullgraph(nodes, edges, data). A linearstages[]snapshot is kept so older clients still compile. Missing /1still migrates fromstages[]+layouton load. - Condition nodes (
police_count,cooldown,has_item, …) have YES / NOports. The server executor walks those edges. Action nodes still allow only one THEN. Conditions are evaluated server-side — including
weather/in_vehicle/time_of_day(fromGlobalStatewhere a weathersync resource publishes it, else real time / not-blocking). - Graph action steps (
goto,interact_door,deliver_item,entry, …) arere-checked on the server exactly like the linear
stages[]path: distance to the step, the required item (consumed only after every check passes), the door lock, the site id. The client callback cannot advance a step from out of range or without the item. - Flow nodes: notify, invite, set cooldown, rejected, success.
- World / cinema / security / NPC nodes are in the library (heists get
entry/loot/guard/alarm/keycard_reader/laser/cctv/npc; legal jobs never do). - Asset PICK drawers (items, peds, props, weapons, vehicles, sounds, FX) hover-preview
on the admin client only.
- Every prop model field (job/heist stages, start object, sites, storage containers, scene
pins, door models) has a BROWSE button that opens a searchable prop browser with thumbnails and groups (ported from GR1M_Craft's
/gcadminpicker, no runtime dependency). Groups live inconfig/prop_catalog.luaand thumbnails inweb/props/; rebuild both withpython tools/build-prop-catalog.py(needs Pillow) after adding a prop pack. - Caps: 256 nodes / 512 edges. Player clients never receive the authoring graph.
Workspace shortcuts: drag empty space to pan, scroll to zoom, drag a port onto another card to connect, drop a library item onto the board to place a step.
- Stats tab logs completed runs (
gr1m_jobs_runs) — starts, win rate, duration.
#Doors map
Doors plot at their real world X/Y, so the doors in one building cluster together instead of being scattered by alphabetical order.
| Input | Action |
|---|---|
| Left-drag on empty space | Marquee select |
| Shift + marquee | Add to selection |
| Alt + marquee | Subtract from selection |
| Right-drag / middle-drag | Pan |
| Wheel | Zoom at cursor |
| Click a dot | Select one door and open its form |
F / G / Esc | Fit · Group selection · Clear selection |
LEFT-DRAG: SELECT in the sidebar toggles left-drag back to panning.
Select two or more doors and the detail pane becomes a bulk panel: group them as a building, move them to an existing one, lock/unlock, enable/disable, or delete.
Buildings are a first-class record (gr1m_jobs_door_groups): id, label, colour. Deleting a building never deletes its doors — they fall back to ungrouped. Every door is also auto-tagged with its GTA zone (GetNameOfZone) the first time an admin opens the panel, so the tree is useful before you group anything.
The fastest way to add a building's doors: stand inside it → CAPTURE DOOR → press E on each door → ENTER → SAVE AS BUILDING. The name is prefilled from the zone.
#Grouping vs pairId — behaviour change
Capturing several doors at once used to chain them into a pairId ring, so unlocking any one of them unlocked all of them. That was pairId standing in for the grouping concept that did not exist yet.
Multi-capture now creates a building group and leaves pairId unset. pairId means one physical double door. Set it by ticking "These two are one double door" on a two-door capture, or select exactly two existing doors (including ones already in a building) and PAIR AS DOUBLE DOOR. Saving a door with a paired ID writes the link both ways. Unlocking either leaf unlocks both.
A building group does not gang-lock. To undo a pair, UNPAIR DOUBLE DOOR on a two-door selection, or clear Paired door ID under SHOW ADVANCED and save.
Tick Gang owned to restrict a door to listed op-crime organisations (optional min gang grade under SHOW ADVANCED). Jobs and gangs are an OR: a listed job can still open a gang door. Leave jobs empty for a gang-only door.
#Player flow
- Doors: per-door Unlock with — Ox Target (aim anywhere on the door mesh) or Ox Lib (lock icon on the door + E). Server checks job and/or op-crime gang, grade, item, hours, distance. Empty job and gang lists = anyone. If both lists are set, either affiliation is enough. Gang-gated doors fail closed when
op-crimeis stopped. - Jobs: target the start point. Stages use waypoints + server distance checks.
/gjcancelaborts.interact_propuses GR1MJobs-spawned objects (Place from the Jobs admin stage). - If the job has a work vehicle model, it spawns at start with temporary keys for the run and is deleted when the job ends.
- Heists: start near the marker; nearby players within join radius become the crew. Entry
runs an
ox_libskillCheck, loot is one-shot per spot (optional GR1MJobs-spawned prop from Place on the loot spot), escape finishes the run. - Loot and escape both require entry to be done first. Escape used to complete a heist as
a success the instant it started if the escape point sat near the start point.
#Heist Setup
web/js/heistform.js is a form over the same graph the board edits. It owns the step order (Start, way in, alarm, extra hack, lasers, escape) and marks its way-in step with wayIn. A heist it cannot show (conditions, cinema, YES / NO branches, extra steps) opens on the board with the reason. Heists made in Setup save locations = true: the master has no start and only runs at its locations, like an item heist. Each location places its start point and, for a lockpick / keypad / keycard way in with "Each location has its own locked door", captures its own door (saved in Doors, locked, unlocked when the crew gets in). With no Escape the run parks after the way in and closes once everything is taken, the crew is 200 m away, or the time runs out; a failed lockpick or hack is a retry. Older heists with their own start point keep running there and can add locations too.
Players: carrying an item a heist accepts shows "Use X here" (or "Put your weapon away") at a target (gj:iheist:near); a refused start says why; the tracker shows the time left.
#Item heists
A heist with a Plant item step has no start point. NEW in the Heists tab, then Item heist, builds one.
- A master holds the steps, items, loot and payout. Copies (the COPIES button in the heist) hold only their own spots, props and cooldown, so editing the master updates every linked copy. Unlink splits a copy into its own heist; Relink puts it back.
- ADD COPY needs GR1M_Placer running. It walks every step that has a position: target, safes, then the rest. ESC stops and keeps what was placed; the copy shows NOT PLACED until FINISH PLACING. Door and site steps stay shared between copies.
- The Plant step can target a real door or object: each copy picks it in Add Copy, and when the charge goes off it is blown away or swings open until the run ends. A door already set up in the Doors tab is unlocked and relocked through that door instead. Capturing on the Plant step or in Add Copy saves it in the Doors tab, locked for everyone until the item is used, then opens the placer so the item sits exactly where you want. A breached door stays that way for the Plant step's relock time after the run.
- Players use an accepted item within 3.5 m of a target. Anywhere else the item behaves normally, including any other script's use of it. The crew invite goes out first, then the plant. The item is only taken when the plant finishes.
- Style: Explosive (countdown, blast), Thermite (burn), Quiet tool (no effects). Safes appear after that and only exist during the run. Each has its own minigame, loot table, rolls and failed hack limit.
- Loot points work alongside safes, or instead of them: add a Loot point step, each copy places it, and it opens to the crew after the plant with no hack.
- The Escape step is optional and off in new item heists. Without it there is no exit to reach: the run closes itself once everything is taken, the crew is 200 m away, or the time limit passes, and it counts as a success if anything was taken. Going down does not fail the crew.
- A Locked door step adds another door to the heist, with its own items and way through. Each copy captures its own, and the crew can work it once the heist has started.
- A loot point can be a spot, something in the map like a cash register, or a prop you place. Each has its own loot table, search time and rolls.
- Items need free hands to use, because ox_inventory refuses most items while a weapon is out.
- Copy and crew cooldowns start when the plant finishes. The crew cooldown and live limit cover every copy of a master.
- Cop minimums count
copCountJobs(Marshals) everywhere in GR1M_Jobs, and FIB can never count. Alerts go toalertJobs(Marshals, FIB). Both are in Settings.
Code: server/item_heists.lua, client/item_heists.lua, web/js/copies.js. Copies are stored in gr1m_jobs_heist_copies and generated into the heist map as normal defs, so runs, loot, escape and stats work per copy.
#Heist entry
The skill check itself runs on the client, so its result is client-supplied and no server can make that unforgeable. What the server does enforce:
gj:heist:entryBeginopens an attempt — re-checking stage, entry state andproximity — and returns a one-shot token.
- The result must come back with that token. It is consumed on first use, expires
after 60 s, and is rejected if it returns faster than a human could finish the check.
- The stage and proximity gates are re-checked on submission, so walking away
mid-minigame does not open the door.
Replaying gj:heist:entry therefore no longer works; previously the result was accepted on its own.
#Config seeds
Edit then empty the matching DB table (or delete rows) if you want seeds to load again:
config/doors.luaconfig/jobs.luaconfig/heists.luaconfig/sites.luaconfig/settings.lua— defaults; overlay saved from the Settings tab intogr1m_jobs_settings.
The four seed files are server-only; clients only receive config/settings.lua.
#Runs and crews
Settings in config/settings.lua:
| Key | Default | Meaning |
|---|---|---|
InviteTimeout | 25 | Seconds a crew invite stays open. The run starts when everyone has answered, the crew is full, the timeout passes, or the leader presses Start now (F7 while waiting also offers Cancel invite). |
RejoinGraceSeconds | 180 | A member who disconnects can rejoin the same run within this window; penalties apply after it. |
Heat.decayPerHour | 5 | Heat cools off lazily when read. Heists can set maxHeat (any hotter member can't start or join) and graph runs can branch on a heat condition. |
GraphGateMinMs | hack/keycard 300, laser 1500 | Minimum time before a graph hack, keycard or laser answer is accepted. |
LaserMaxDistance | 25.0 | A laser result is only accepted from near the beam. |
- Every crew member's job, grade, duty, cooldown and heat are checked at start; members who fail are told why and left out.
- Rewards that don't fit go into one ground drop at the player.
- The player cooldown applies on success, fail, cancel, timeout and disconnect. A resource restart refunds the entry and applies no heat or cooldowns.
- Editing or deleting a job/heist ends its live runs with a refund and no penalty.
- Heists can require
minPoliceon-duty police.
#Fluids and fuel
Fills, unloads and pickups are server-timed (gj:site:beginFill / gj:site:beginUnload hand out a token; the finish is rejected if the progress bar was skipped). The hose ticks once per Sites.HoseTickMs and shows tank %, litres moved and drum litres; it stops when you walk away, the vehicle leaves, the tank is full or the drum is empty. Drum items show fluid and litres in their tooltip. The fluid_drum item only carries fluid in the inventory; placing it as a world drum is off unless Sites.AllowDrumDeploy = true, and drums placed before that can still be picked up by their owner. While filling, the player holds a jerry can (Sites.FillProp, Sites.FillAnim) and the hose runs from the site to its cap; unloading pours from the can (Sites.UnloadAnim).
#UltraBoss
| GR1MJobs | UltraBoss |
|---|---|
| Occupation dropdown | GetJobsList / qbx_core:GetJobs |
| Create occupation checkbox | SaveJob (same as /gr1mboss (GR1M_UltraBoss) Jobs) |
| Society reward amount | AddMoney |
| Duty check | PlayerData.job.onduty |
#Exports (server)
exports.GR1M_Jobs:GetDoor(id)
exports.GR1M_Jobs:SetDoorLocked(id, isLocked)
exports.GR1M_Jobs:IsDoorLocked(id)
exports.GR1M_Jobs:RegisterDoorAccessRule(id, rule)
exports.GR1M_Jobs:StartJob(source, jobId)
exports.GR1M_Jobs:StopJob(source, reason)
exports.GR1M_Jobs:GetJobConfig(jobId)
exports.GR1M_Jobs:GetActiveJob(source)
exports.GR1M_Jobs:ListJobs()
exports.GR1M_Jobs:GetHeat(sourceOrCitizenid)
exports.GR1M_Jobs:StartHeist(source, heistId)
exports.GR1M_Jobs:GetHeistStatus(heistId)
exports.GR1M_Jobs:GetHeistConfig(heistId)
exports.GR1M_Jobs:AbortHeist(heistId, reason)
exports.GR1M_Jobs:ListHeists()
exports.GR1M_Jobs:GetSiteConfig(siteId)
exports.GR1M_Jobs:ListSites()
Client minigames:
exports.GR1M_Jobs:RegisterMinigame('mygame', function()
return lib.skillCheck({'easy'}, {'e'})
end)
Heist stages reference the minigame name (skillcheck by default).
#Events
AddEventHandler('GR1M_Jobs:heistAlert', function(payload)
-- payload.heistId, label, coords, jobs
end)
AddEventHandler('GR1M_Jobs:heatChanged', function(source, citizenid, heat)
end)
AddEventHandler('GR1M_Jobs:doorToggled', function(source, doorId, locked)
end)
AddEventHandler('GR1M_Jobs:jobCompleted', function(source, payload)
-- payload.jobId, coords, stayOn, startedAt
end)
AddEventHandler('GR1M_Jobs:stageCompleted', function(source, payload)
-- payload.jobId, stageId, stageIndex, coords, stayOn, startedAt
end)
Optional stayOn on an activity job (Jobs admin → Rewards) credits GR1M_StayOn if that resource is running. StayOn listens; Jobs does not call it.
Default police alert also fires kartik-mdt:server:sendDispatchNotification when that resource is started and Settings → Dispatch is on. Audience is GJConfig.PoliceJobs (police, bcso, marshals).
#Permissions wiring
Staff who already use /gr1mboss (GR1M_UltraBoss) can open GR1MJobs. Extra ACE:
add_ace group.admin gr1mjobs.admin allow
#The command ACE no longer grants access
GR1MJobs used to accept anyone holding the command ace. command is the parent object of every console command, so granting a support group a couple of commands handed them full write access to every door, job, heist and global setting, plus the door importer.
That is now opt-in and off by default. If staff who could previously open the panel suddenly cannot, give them the real ace:
add_ace group.mod gr1mjobs.admin allow
Or, to restore the old behaviour, set GJConfig.AllowCommandAce = true in config/settings.lua — understanding what it grants.
Every admin mutation is now logged to the server console with the actor's name and identifier.
Never trust NUI: every admin callback re-checks GJAdmin.IsAdmin. Door toggles, loot, and job stages always re-check distance and items on the server.
GR1M