For the complete documentation index, see llms.txt. This page is also available as Markdown.

Additional Informations

Page dedicated to Additional Informations about our DOJ MDT [V2].

Core Features

  • Universal Framework Support: Works with ESX, QBCore and QBox, detected automatically.

  • Court Cases: Docket with parties, charges from your penal code, notes, evidence and a case timeline.

  • Warrants & Verdicts: Warrants requested by staff and decided by a judge. Verdicts with fines, jail time, penalty points and licence suspensions.

  • Hearings: Calendar per courtroom with attendance, outcomes and a warrant request for a no-show.

  • Court Papers: Verdicts, warrants, summonses and your own templates printed as items, with the judge's signature and a code anyone can verify.

  • Court IDs: One card with a serial per official, issued at the e-office and shown only to players who can actually see you.

  • Identity Documents: ID cards, driving licences, weapon permits and residence cards with a photo from the booth, linked to your framework's licence flags.

  • Citizen E-Office: Players read their own papers, cases and hearing dates, pay fines and ask for counsel at the courthouse counter.

  • Several Offices: The bench, the prosecution and the defence on one tablet, each with its own ranks, colours, court ID and letterhead.

  • Police MDT [V2] Bridge: Charges filed in the police tablet open a DOJ case automatically.

  • Banking V2 Billing: Optional penal code, fees and verdict fines through our Banking [V2].


Server Security

Every permission is checked on the server, not only hidden in the interface. Showing a court ID or a document is decided on the server too: the client only asks to show it, so a modified client cannot invent a card, put another name on it or show it across the map. The e-office answers only with the caller's own record.


Your Own Pictures

Office logos, card backgrounds, letterhead logos and seals live in the artwork/ folder next to fxmanifest.lua. They are served as they are, so nothing has to be rebuilt: drop the file in, name it in the config without the folder ("da.webp", "offices/da.webp") and restart the resource. An https address works too. /mdt doctor lists every configured file that is missing.


Enforcing a Sentence

The tablet records sentences. It does not jail anyone or move money by itself, because every server does that differently. Two hooks in config/server/editable.lua are called with the finished decision:

defendantSource and targetSource are nil when that player is offline, so always check them.


Developer API (Exports & Events)

identifier is the character identifier your framework uses (users.identifier on ESX, citizenid on QBCore and QBox). Every export checks its input and answers an empty result or nil, errorKey instead of raising an error.

Court

Export
Description

getActiveWarrants(identifier)

Approved warrants still in force, newest first.

hasActiveWarrant(identifier, type)

true or false. type is optional and comes from Config.Warrants.types.

getCitizenRecord(identifier)

Summary (open cases, convictions, unpaid fines, active warrants) with the last cases, verdicts and warrants. No ruling text.

createCase(data)

Opens a case: title (required), type, status, description, defendantId, defendantName, charges, sourceRef. Returns caseId, signature.

RevokeCourtId(identifier)

Voids an official's court ID, for servers that dismiss staff in another resource.

Identity documents

Export
Description

getIdentityDocuments(identifier)

Documents of a citizen.

hasValidIdentityDocument(identifier, kind)

Whether the citizen holds a valid document of that kind.

canIssueIdentityDocument(identifier, kind)

Runs the checks of the counter without issuing anything.

issueIdentityDocument(identifier, kind, options)

Issues a document, for example a driving licence after a passed test.

getIdentityPoints(identifier)

Current penalty point balance.

addIdentityPoints(identifier, points, options)

Adds points. Pass options.sourceRef so a repeated call is not counted twice.

checkIdentityCode(source, code)

Checks the code printed on a card, for example from your police tablet.

seizeIdentityDocument(source, code, reason)

Seizes a document by its code.

Dispatch, staff and logs

Export
Description

CreateCall(data)

Raises a request on the board: title and coords required, code, priority, job and more.

CreateCitizenCall(source, data)

Same as above, raised by a player. Position and caller name are taken from the player.

CloseCall(callId, reason)

Closes a request.

AddLog(source, tag, text, color, fields, args, caseId)

Adds an entry to the Audit Log.

GetOfficerBadge(identifier) / SetOfficerBadge(identifier, badge)

Reads or sets an official's badge number.

GetOfficerHours(identifier)

Hours on duty.

RefreshOfficer(identifier)

Rereads badge, grade and radio of an online official.

GetPoliceBridgeStatus()

Whether the Police MDT bridge is enabled and active.

Local server events (AddEventHandler), never sent to clients. Dates are unix seconds.

Event
When it fires

qf_mdt_doj_v2:verdictIssued

After a verdict is stored and EDITABLE.OnVerdictIssued ran.

qf_mdt_doj_v2:verdictVacated

Once per vacated verdict.

qf_mdt_doj_v2:warrantApproved

After EDITABLE.OnWarrantApproved.

qf_mdt_doj_v2:warrantExpired

Once per warrant, from the expiry check.

qf_mdt_doj_v2:hearingScheduled

When a hearing is put in the calendar, and again with rescheduled = true when moved.

qf_mdt_doj_v2:identityDocument*

On every change of an identity document: Issued, Renewed, Suspended, Restored, Revoked, Expired, Replaced, Seized, Reported.

Each acts on the local player's screen only.

Export
Description

openCitizenPortal()

Opens the citizen e-office, for servers with Config.Portal.spawnPeds = false.

openIdentityStudio()

Opens the photo booth at the nearest studio location.

openIdentityForgery()

Opens the forgery panel when Config.Identity.forgery is enabled.

showOfficerBadge(card, duration)

Shows a court ID card built by the calling resource.

showDispatchAlert(data)

Shows the popup for a request. Create real requests with CreateCall.

GetMugShotBase64(ped, transparent)

Renders a mugshot of the ped and returns it as a base64 string.

config/server/editable.lua and config/client/editable.lua hold the functions that talk to the rest of your server. They stay open after escrow and are meant to be edited.

Frequently changed hooks:

Hook
Purpose

EDITABLE.OnVerdictIssued(verdict, defendantSource)

Jail time and fines in your prison and billing resources.

EDITABLE.OnWarrantApproved(warrant, targetSource)

What an approved warrant does on your server.

EDITABLE.GetName(identifier)

How a citizen's name is resolved from your database.

EDITABLE.GetBadge(xPlayer)

Badge number shown on the court ID.

EDITABLE.GetPlayerLicenses / GiveLicense / RevokeLicense

Where licences are read and written.

EDITABLE.GetBankBalance / ChargePlayer / RefundIdentifier

How fines and fees are charged and refunded.

EDITABLE.AddMoneyToSociety(amount, jobName)

Where the court's share of a payment goes.

EDITABLE.CreateBilling(...)

Bridge into your billing resource.

EDITABLE.GiveCodedItem / RemoveCodedItem / HasCodedItem

Adapter for an inventory that is not supported out of the box.

EDITABLE.OnStatusChange(source, status)

Fired when an official goes on or off duty.

EDITABLE.CanOpenMDT() (client)

Extra conditions before the tablet may open.

Discord logs

Every Audit Log entry can be copied to a Discord webhook. The webhook lives in EDITABLE.Logs in config/server/editable.lua on purpose: config/config.lua is sent to every client, and a webhook address is a secret.


Frequently Asked Questions (Q&A)

Q: The tablet does not open at all. A: Check that the player's job is in Config.Jobs and that their grade exists in Config.Grades. Run /mdt doctor for a full configuration check.

Q: The court ID item does nothing or shows somebody else's card. A: With Config.Badge.item.mode = "owner" every official carries their own card with a serial number, so a stolen card always shows its owner. The item qf_mdt_doj_v2_badge must exist in your inventory. With Config.Badge.issue = "portal" the card is applied for and collected at the e-office.

Q: Verdicts do not jail anybody. A: The tablet records the sentence only. Connect your prison in EDITABLE.OnVerdictIssued or listen to qf_mdt_doj_v2:verdictIssued (see Enforcing a Sentence).

Q: My penal code changes in the config are ignored. A: The seed is imported only once, into an empty table. After that the penal code is edited in the tablet. Set Config.PenalCode.reseedOnStart = true for one restart to import it again, then turn it back off.

Q: The photo booth does not open. A: It needs screenshot-basic running. Without it cards carry the mugshot the MDT already stores (Config.Identity.photoFallback).

Q: Players' existing licences disappeared after installing. A: They did not. The identity module never touches a licence it did not set and does no bulk sync. A player who holds a licence without a card can apply for one, or use Config.Identity.transition to let them collect it for free for a while.

Q: Police charges do not appear as DOJ cases. A: Check exports.qf_mdt_doj_v2:GetPoliceBridgeStatus(). The bridge needs qf_mdt_police_v2 running, and Config.PoliceBridge.tables must match the police Config.Base if you renamed its tables. Charges without jail time are skipped unless importFineOnlyCharges = true.

Q: Requests appear twice on screen. A: Another dispatch resource is drawing them as well. Set Config.Dispatch.ShowOnScreenAlerts = false.

Last updated