GR1M Docs

Licenses

Licenses, permits and department certifications. Can take over from bit-licenses style license items.

v1.0.0Needs oxmysql, ox_lib, qbx_core, ox_inventory

#Commands

CommandWhoWhat
/glicensesadmins (gr1mlicenses.admin ace or qbx admin/god)Builder: types, departments, desks, routes, written tests, settings, player records
/licenseeveryoneLicense & Certification screen (the source of truth): everything you hold, status, points, expiry, and Show to people nearby
/licensecheckpolice/marshals + anyone who can issue somethingCheck, suspend, revoke, add points, issue, sign off tests
/canceltestplayer on a practicalAbandon the test (counts as a fail)

Wallet and officer command names are editable in Settings (restart to apply).

#How it fits together

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