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

Additional Informations

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

Core Features

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

  • Repair Jobs: Generated jobs around the map with per-fault repair steps, client peds, tow integration and automatic payouts.

  • Client & Vehicle Records: Searchable citizens and vehicles with notes, tags, mugshots and license overview.

  • Invoicing: Configurable price list, per-grade limits and bridges into most popular billing and banking resources.

  • Dispatch & Live Map: Alerts, units and patrols shared with the other QF tablets, plus a live map of workshops and vehicles.


Developer API (Exports & Events)

AddLog

Adds an entry to the Audit Log — useful for logging tool usage, parts withdrawal or boss menu actions from other resources.

Syntax:

exports.qf_mdt_mechanic_v2:AddLog(source, tag, text, color, fields, args)
Parameter
Type
Description

source

number

Player source ID. nil is logged as "System".

tag

string

Category tag (e.g. 'parts', 'tasks', 'boss').

text

string

Log message.

color

string

Color theme: blue, red, green, orange, black.

fields

table

(Optional) Key-value pairs with extra metadata.

args

table

(Optional) Arguments for translation if text is a locale key.

exports.qf_mdt_mechanic_v2:AddLog(
    source,
    "parts",
    "Withdrew parts from the workshop stock",
    "orange",
    {
        part = "Turbocharger",
        amount = 1,
        vehicle = "ABC 123"
    }
)

CreateDispatchAlert

Sends a dispatch alert to every employee on duty.

Parameter
Type
Description

coords

vector3

Location of the alert.

title

string

Alert header.

description

string

Detailed info, e.g. street name and vehicle.

code

string

Dispatch code.

colorRGB

table

{r, g, b} format.

maxUnits

number

(Optional) How many units may attach.

duration

number

(Optional) Time in ms the alert stays on screen.

Badge & Bodycam

Other exports

Export
Description

GetMugShotBase64(ped, transparent)

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

showDispatchAlert(data)

Draws a dispatch alert on screen without going through the dispatch system.

updateReactions(data)

Updates the unit reactions shown on an alert that is already on screen.

config/server/editable.lua and config/client/editable.lua hold the functions that talk to the rest of your server. They are plain Lua and meant to be edited — this is where you adapt the tablet to a custom licence system, a custom billing resource or your own name lookup.

Frequently changed hooks:

Hook
Purpose

EDITABLE.GetBadge(xPlayer)

Badge number shown on the employee badge.

EDITABLE.GetName(identifier)

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

EDITABLE.GetPlayerLicenses(identifier)

Where licenses are read from.

EDITABLE.GiveLicense / RevokeLicense

How licenses are granted and revoked.

EDITABLE.GetPlayerVehicles(identifier)

Vehicle lookup for the records page.

EDITABLE.GetVehicleModel(source, modelID)

Turning a model hash into a readable name.

EDITABLE.ChargePlayer(source, amount, why)

How a client is charged for an invoice.

EDITABLE.AddMoneyToSociety(amount, jobName)

Where the company share of an invoice goes.

EDITABLE.CreateBilling(...)

Bridge into your billing resource.

EDITABLE.TakeMugshot(playerId)

Mugshot capture.

EDITABLE.OnStatusChange(source, status)

Fired when an employee goes available/unavailable — see below.

EDITABLE.CanOpenMDT() (client)

Extra conditions before the tablet may open.

Duty status hook


Frequently Asked Questions (Q&A)

Q: The tablet does not open at all. A: Check that the player's job matches Config.Jobs and that their grade exists in Config.Grades. Config.Debug = true prints the resolved job and grade to the server console.

Q: Repair jobs never appear on the Tasks page. A: Jobs are generated on an interval — Config.Tasks.RefreshInterval — up to MaxAvailableJobs at a time. Right after a restart the first batch takes one interval to appear.

Q: Recovery jobs should use my tow script instead. A: Set the matching entry in Config.Tasks.CustomTowScript, e.g. jo_towtruck = true. The tablet then hands the vehicle over instead of running its own recovery logic.

Q: Invoices do not show up in my billing resource. A: Enable exactly one entry in Config.Billings. If your resource is not listed, implement EDITABLE.CreateBilling in config/server/editable.lua instead.

Q: Alerts appear twice on screen. A: An external dispatch is drawing them as well. Set Config.Dispatch.ShowOnScreenAlerts = false.

Last updated