GR1M Docs

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.

v1.0.0Needs oxmysql, ox_lib, qbx_core, ox_inventory

This is a first-party replacement for jaksam doors_creator / robberies_creator. Do not lock the same world doors from both systems.

#Requirements

#Install

  1. Folder must be named GR1M_Jobs.
  2. Schema auto-creates on first boot (or import sql/install.sql).
  3. Lua files under config/ are seed only. After the matching MySQL table has rows, the database is the source of truth.
  4. 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:

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

#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.

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.

#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.

InputAction
Left-drag on empty spaceMarquee select
Shift + marqueeAdd to selection
Alt + marqueeSubtract from selection
Right-drag / middle-dragPan
WheelZoom at cursor
Click a dotSelect one door and open its form
F / G / EscFit · 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

#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.

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:

  1. gj:heist:entryBegin opens an attempt — re-checking stage, entry state and

    proximity — and returns a one-shot token.

  2. 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.

  3. 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:

The four seed files are server-only; clients only receive config/settings.lua.

#Runs and crews

Settings in config/settings.lua:

KeyDefaultMeaning
InviteTimeout25Seconds 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).
RejoinGraceSeconds180A member who disconnects can rejoin the same run within this window; penalties apply after it.
Heat.decayPerHour5Heat 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.
GraphGateMinMshack/keycard 300, laser 1500Minimum time before a graph hack, keycard or laser answer is accepted.
LaserMaxDistance25.0A laser result is only accepted from near the beam.

#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

GR1MJobsUltraBoss
Occupation dropdownGetJobsList / qbx_core:GetJobs
Create occupation checkboxSaveJob (same as /gr1mboss (GR1M_UltraBoss) Jobs)
Society reward amountAddMoney
Duty checkPlayerData.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.