Licenses
Licenses, permits and department certifications. Can take over from bit-licenses style license items.
#Commands
| Command | Who | What |
|---|---|---|
/glicenses | admins (gr1mlicenses.admin ace or qbx admin/god) | Builder: types, departments, desks, routes, written tests, settings, player records |
/license | everyone | License & Certification screen (the source of truth): everything you hold, status, points, expiry, and Show to people nearby |
/licensecheck | police/marshals + anyone who can issue something | Check, suspend, revoke, add points, issue, sign off tests |
/canceltest | player on a practical | Abandon the test (counts as a fail) |
Wallet and officer command names are editable in Settings (restart to apply).
#How it fits together
- Source of truth:
gr1m_licenses_records(one row per character per type). Status ispermit,active,suspended,revokedorexpired. - Mirror: each type's "Qbox license key" is written to
metadata.licences(true only whenactive), so ox_inventory shoplicense =checks, MDTs and anything else reading metadata keep working. - Kartik MDT: approve/revoke in the MDT calls
exports.GR1M_Licenses:MdtUpdatethroughkartik-mdt/bridge/license/server/gr1m_licenses.lua(copy it frominstall/kartik-mdt_gr1m_licenses.lua). Kartik only lists the ids in itsConfig.Licenses; add new keys there if you want them in the MDT. - Cards: the type's card item (
license_*items, ininstall/ox_inventory-items.lua) carrieslicenseType+cid. Status is read live when shown, with a headshot of the owner when they are nearby. The ox "View" button and using the item both show it. - Playtime: suspensions and expiry count the holder's playtime (a minute tick for online players), tracked in
gr1m_licenses_citizens. - Jobs: every held job counts (Qbox
PlayerData.jobsmultijob), not only the active one. "Auto-grant while holding" gives credentials; "Must hold one of" pauses a cert when they leave and restores it when they return. - No drive blocks (2026-11-20): licenses never stop anyone driving, flying or sailing, so stolen boats and aircraft still work. Boat, pilot and helicopter licenses are checked when buying at GR1M_Dealerships instead. The old "Hard block" toggle and
client/blocks.luaare gone. - Weapon gates: the Weapon gates tab lists weapons only certain people may equip: anyone holding one of its jobs, or an active license/cert from its list. Checked on the server through ox_inventory's
usingItemhook (no ox edits), and a gated weapon already in hand is holstered when the player loses the job or the cert. Seeded: stun gun forpolice,bcso,sasp,marshalsor the Tac-EMS cert (EMS command issues it). Staff withgr1mlicenses.exemptskip gates. Also seeded (2026-11-16): Class 3 weapons (every SMG, rifle, shotgun, sniper and MG; only theclass3cert passes, police included) and Heavy weapons (launchers, miniguns, railguns; staff only; explosives are not gated). A gate's "Let unregistered (black-market) guns through" toggle lets guns withregistered = falseor no serial skip it. "Forged cards (GR1M_FakeID) count" (on by default) lets a forged card of the gate's type in pockets pass it; dropping the card holsters the gun.
#Earning
Any mix per type: buy at a desk, written test (random questions from a bank), practical route (self-service, instructor, or both), instructor-issued, auto by job. Written → practical gives a permit after the written when the type has a permit stage. New characters get the types in Settings → "New characters start with" (a Learner Permit for driving by default).
#First start
Seeds default types, departments (LSPD, BCSO, SASP, Marshals, EMS), sub-department certs, quizzes and three DMV desks, then imports every character's existing metadata.licences and bit_licenses rows once. Every character seen then counts as existing, so only characters made later get the new-resident permit. Routes are not seeded: build them in the Routes tab and pick them on each type.
#Felons
server/felony.lua keeps a felony record per character (gr1m_licenses_felonies). Kartik MDT is escrowed, so entries come from dynyx_prison:addprisoner (MDT jailings and the prison menu): each charge title is looked up in Kartik's penal code (mdt_penal_code, mdt_criminal_codes) and any code whose category says Felony is recorded. Lifers always count, and a prison sentence whose charges match no code counts when Settings → "Count a prison sentence as a felony" is on. First start also scans everyone serving a sentence now. Admins add or clear entries under Players.
Settings → Felons: the master toggle and which types it blocks (default weapon). A blocked type is refused at the desk (written and practical tests, purchase, renewal), by instructors, and by MDT approval. Admin grants still work. Licenses already held are not touched.
#Exports (server)
HasLicense(srcOrCid, type), GetStatus, GetLicenses, Grant(target, type, 'active'|'permit', actor, reason), Suspend(target, type, minutes, actor, reason), Revoke, Reinstate, AddPoints(target, type, n, actor, reason), MdtUpdate, HasFelony(target), AddFelony(target, charges, actor), ClearFelonies(target, actor).
GR1M