Skip to content

Bridges ​

np_identification talks to frameworks, inventories and MDTs only through bridges: Ident.Framework, Ident.Inventory and Ident.MDT. Each bridge file calls Ident.Bridge.shouldLoad(kind, name, resource) and returns early unless its resource is started and selected (Config.Framework, Config.Inventory, Config.MDT, or 'auto'). Files are numbered, so auto takes the first that is started; 9_standalone.lua / 9_none.lua claim the slot when nothing else loaded. Detection runs once at start, so start your framework and inventory before np_identification. The console prints the chosen bridge:

[np_identification] framework bridge: qbx
[np_identification] inventory bridge: ox
[np_identification] mdt bridge: none

Every bridge call goes through pcall, so a missing export degrades a feature instead of throwing errors.

Framework ​

bridge/framework/server/ (and client/). Order: qbx_core → qb-core → es_extended → standalone.

Contract Used for
getIdentifier(src) / getName(src) The citizen id that owns documents, the display name
getCharacter(src) { citizenid, firstname, lastname, dob, sex, height, nationality } for character.* fields
getJob(src) { name, label, grade, gradeLabel, onduty, callsign? }: clerks, police, badges, job.* fields
getMoney / removeMoney / addMoney Fees and refunds (cash / bank)
addSocietyMoney(account, amount) Fees with rules.account
getSourceByIdentifier(id) Notifying owners who are online
isAdmin(src) The framework's own admin check. Only a fallback while np_admin is not running (Permissions)
getJobs() The job list in the designer
onPlayerLoaded / onPlayerUnloaded Init payload, reminders, closing the UI
qbx (qbx_core) qb (qb-core) esx (es_extended) standalone
Citizen id citizenid citizenid xPlayer.identifier license:…
Name, birth date, sex, nationality charinfo charinfo firstName, lastName, dateofbirth, sex, nationality Player name only (the rest becomes desk inputs)
Height charinfo.height or metadata.height same (usually missing → desk input) height desk input
Job, grade, duty job, job.grade.level, job.onduty same job, job.grade, job.onDuty unemployed, grade 0
Callsign metadata.callsign metadata.callsign callsign –
Money exports.qbx_core:RemoveMoney / AddMoney Player.Functions.RemoveMoney / AddMoney removeAccountMoney / addAccountMoney (cash = ESX money) none: every price is 0
Admin (fallback without np_admin) HasPermission(src, 'admin') admin / god permission group admin / superadmin none
Jobs list GetJobs() QBCore.Shared.Jobs ESX.GetJobs(), else the jobs table empty

Birth dates in the usual framework formats (ISO, DD/MM/YYYY, DD.MM.YYYY, unix timestamps) are converted to ISO. Sex values (0 / 1, m / f, male, female, …) are normalised to m, f or x. Callsigns like NO CALLSIGN count as unset.

Society accounts (addSocietyMoney) go to the first banking resource that is running: Renewed-Banking, qb-banking, qb-management, okokBanking, esx_addonaccount. np_banking is not one of them: with np_banking, let fees go through np_payments (the default Config.Payments = 'auto'), which credits the type's society through its banking provider, np_banking's job account.

On the client, the bridge provides isLoaded, isDead, isCuffed (framework flag, state bags or IsPedCuffed), getJob, onLoaded and onUnloaded. The UI closes when the player dies, gets cuffed or unloads.

Inventory ​

bridge/inventory/server/. Order: ox_inventory → qb-inventory → ESX → none.

Contract Used for
name, metadata Whether items carry metadata (physical cards need it)
addItem(src, item, metadata) / removeItem(src, item, metadata?) Handing out and removing cards (matched by metadata.serial)
hasItem(src, item, serial?) Presenting a card, the UV lamp
getDocumentItems(src) The picker, police checks, seizures
moveItem(from, to, item, serial) Handing a card over
updateMetadata(src, item, serial, metadata) Refreshing the item tooltip (new expiry) after a renewal
registerUsable(item, cb) Using a card opens the viewer
ox (ox_inventory) qb (qb-inventory, ps-inventory, lj-inventory) esx none
Metadata yes yes (info) no: digital only no: digital only
Usable items server.export hook per item (see Items) QBCore.Functions.CreateUseableItem ESX.RegisterUsableItem (opens the newest document of that type) –

Item metadata of a card: { serial, type, label, description = 'Aiden Pearce · bis 08.01.2027' }. Forged cards add forged and data (the values, photo and dates they show).

MDT ​

bridge/mdt/server/. The warrant check (Haftbefehle in a police check, requires.noWarrant at the desk) asks Ident.MDT.getWarrants(citizenid) -> count, details. Only none ships, which always answers 0.

Plug your MDT in from your own resource, without editing np_identification:

lua
-- server, in your MDT resource
exports.np_identification:setWarrantProvider(function(citizenid)
  local rows = MySQL.query.await('SELECT id, title FROM mdt_warrants WHERE citizenid = ? AND active = 1', { citizenid })
  return #rows, rows
end)

The provider wins over the MDT bridge. Pass nil to remove it. There is one provider: the last call wins. np_prison sets one at start (bail no-shows and escapees count as open warrants; Config.IntegrationOptions.np_identification.warrants = false there turns it off), so an MDT that also sets one replaces it. It is called inside pcall; an error counts as no warrants and prints a warning. Or add a bridge file bridge/mdt/server/N_<name>.lua that starts with Ident.Bridge.shouldLoad('mdt', '<name>', '<resource>') and sets Ident.MDT = { name, getWarrants }.

Tables ​

Created at start (CREATE TABLE IF NOT EXISTS); the same SQL is in sql/install.sql.

Table Holds
ident_documents One row per document: serial (unique), citizenid, type, version, data (field values), meta (weapons), photo, signature, status, status_reason, status_until, points, issued_at, expires_at, issuer
ident_photos Passport photos as JPEG data URLs
ident_points Point entries with reason, officer and expiry
ident_types Designer types: draft, published, version, deleted
ident_type_versions Every published definition, for compare and rollback
ident_exams Exams saved in the designer
ident_exam_results Passed exams per character
ident_log Audit log (action, actor, target, serial, details), pruned after Config.Log.keepDays
ident_desks Desks placed in the designer

Forged documents have no row: they exist only as items.