> For the complete documentation index, see [llms.txt](https://wiki.qfdevelopers.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.qfdevelopers.com/scripts/editor-22/additional-informations.md).

# Additional Informations

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

{% tabs %}
{% tab title="Server Exports" %}
**AddLog**

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

**Syntax:**

```lua
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. |

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

{% endtab %}

{% tab title="Client Exports" %}
**CreateDispatchAlert**

Sends a dispatch alert to every employee on duty.

```lua
exports.qf_mdt_mechanic_v2:CreateDispatchAlert(coords, title, description, code, colorRGB, maxUnits, duration)
```

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

```lua
local coords = GetEntityCoords(PlayerPedId())

exports.qf_mdt_mechanic_v2:CreateDispatchAlert(
    coords,
    "Vehicle Recovery Requested",
    "Broken down vehicle blocking the highway.",
    "10-50",
    { 231, 149, 74 },
    4,
    10000
)
```

**Badge & Bodycam**

```lua
exports.qf_mdt_mechanic_v2:showOfficerBadge({
    name = "Robert Smith",
    badge = "LSC-14",
    gradeLabel = "Leader",
    mugshot = "https://example.com/photo.png", -- optional
    licenses = {
        { label = "Heavy Vehicle", active = true },
        { label = "Tuning Certificate", active = false }
    }
})

exports.qf_mdt_mechanic_v2:showBodycam()
exports.qf_mdt_mechanic_v2:hideBodycam()
exports.qf_mdt_mechanic_v2:toggleBodycam()
```

**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.     |
| {% endtab %}                         |                                                                             |

{% tab title="Editable Hooks" %}
`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**

```lua
function EDITABLE.OnStatusChange(source, status)
    -- status: "available" or "unavailable"

    if status == "available" then
        TriggerEvent('examplemechanicjob:onDuty', source)
    elseif status == "unavailable" then
        TriggerEvent('examplemechanicjob:offDuty', source)
    end
end
```

{% endtab %}
{% endtabs %}

***

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.qfdevelopers.com/scripts/editor-22/additional-informations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
