> 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-5/configuration.md).

# Configuration

Page dedicated to how to configure our Ambulance MDT \[V2]

## Languages

The language of the tablet is set inside `Config.NUI`.

* `en-US`: English
* `fr-FR`: French
* `pl-PL`: Polish
* `de-DE`: German
* `es-ES`: Spanish
* `pt-PT`: Portuguese
* `ja-JP`: Japanese
* `it-IT`: Italian
* `ko-KR`: Korean

```lua
Config.NUI = {
    defaultLangCode = "en-US",
    -- Languages offered in the tablet's own language switcher.
    langs = {
        { code = "en-US", name = "English", iconUrl = "https://.../gb.webp" },
        { code = "pl-PL", name = "Polski",  iconUrl = "https://.../pl.webp" },
    }
}
```

### Commands & Keybinds <a href="#user-content--new-section-commands--keybinds" id="user-content--new-section-commands--keybinds"></a>

**General**

* `/qf_mdt_ambulance_v2` (DELETE): Toggle the MDT Dashboard.
* `/qf_mdt_ambulance_v2_badge` (B): Show/Hide Medic Badge. `/badge` works as a short alias.
* `/bodycam`: Toggle Bodycam Overlay.

**Dispatch**

* `/qf_mdt_ambulance_v2_fastgps` (E): Set the GPS to the latest dispatch alert.
* `/qf_mdt_ambulance_v2_dispatch` (HOME): Open the MDT straight on the dispatch page.
* `/qf_mdt_ambulance_v2_alert_accept` (Z): Accept the latest call on screen.
* `/qf_mdt_ambulance_v2_alert_dismiss` (O): Hide the latest call on screen, for you only.
* `/qf_mdt_ambulance_v2_alert_expand` (J): Show the details of the latest call on screen.
* `/medpanic [note]`: Panic button.
* `/medlocation [note]`: Report your position.

**Citizens**

* `/912 <what happened>`: Call an ambulance. `/912 anon <what happened>` hides the caller.

**Camera Mode**

* `/qf_mdt_ambulance_v2_startcapturephoto` (ENTER): Start capturing a photo.
* `/qf_mdt_ambulance_v2_blocknuifocus` (L-ALT): Block the NUI focus.
* `/qf_mdt_ambulance_v2_cameratakephoto` (SPACE): Take the photo.
* `/qf_mdt_ambulance_v2_cameratogglefocus` (L-ALT): Toggle mouse focus.
* `/qf_mdt_ambulance_v2_cameratoggleflashlight` (F): Toggle camera flashlight.
* `/qf_mdt_ambulance_v2_cameratoggleside` (R): Switch between Front/Back camera.

{% hint style="info" %} <mark style="color:$info;">Note: Both the keys and the command names come from</mark> <mark style="color:$info;">`Config.ToggleMDT`</mark><mark style="color:$info;">,</mark> <mark style="color:$info;">`Config.Camera`</mark><mark style="color:$info;">,</mark> <mark style="color:$info;">`Config.Badge`</mark> <mark style="color:$info;">and</mark> <mark style="color:$info;">`Config.Dispatch`</mark> <mark style="color:$info;">in</mark> <mark style="color:$info;">`config/config.lua`</mark> <mark style="color:$info;">— the names above are the defaults.</mark>
{% endhint %}

#### Running several tablets side by side (`Config.Base`)

Every module stores its data in its own MySQL table, named after the resource (`qf_mdt_ambulance_v2_*`). `Config.Base` lets you point any module at a different table, so a second medical tablet — a fire department copy, for example — can share selected data while keeping its own medics, announcements and radio codes. Leave an entry unset to keep the default, private table, and always share related tables together.

### Configuration <a href="#user-content-configuration" id="user-content-configuration"></a>

The `config/config.lua` file contains the core settings for the resource. Below is a breakdown of the key sections:

#### Main Settings <a href="#user-content-main-settings" id="user-content-main-settings"></a>

| Option              | Description                                        | Example                             |
| ------------------- | -------------------------------------------------- | ----------------------------------- |
| `Config.Frameworks` | Enable or disable support for specific frameworks. | `{ ESX = { enabled = true }, ... }` |
| `Config.Debug`      | Enables debug prints in the server console.        | `true` / `false`                    |

#### Features <a href="#user-content-features" id="user-content-features"></a>

| Option             | Description                                                                  |
| ------------------ | ---------------------------------------------------------------------------- |
| `Config.ToggleMDT` | Controls the keybind and command to open the MDT.                            |
| `Config.Camera`    | Settings for the integrated camera system (blocking NUI focus, capture key). |
| `Config.Badge`     | Settings for the medic badge display (keybind, command).                     |
| `Config.Basics`    | Visual customization, primarily the primary color using HSL format.          |

#### NUI Settings (`Config.NUI`) <a href="#user-content-nui-settings-confignui" id="user-content-nui-settings-confignui"></a>

This section controls the visual aspect and functionality of the UI:

* **`fractionName`**: The short name displayed for the department (e.g., "EMS").
* **`primaryColor`**: The implementation of the primary color in RGB format for the UI.
* **`sidebarPages`**: Toggle visibility of specific sidebar pages (e.g., set `home = { show = false }` to hide the home page).
* **`medications`**: Define available medications, their dosage rates, and units.
* **`medProtocols`**: Define medical protocols, side effects, and contraindications for each medication.

#### Gameplay Systems <a href="#user-content-gameplay-systems" id="user-content-gameplay-systems"></a>

* **`Config.Pharmacy`**: Configures the pharmacy NPC, location, and blip. Supported `targetSystem` options include `ox_target`, `qb-target`, `qtarget`, or `auto`.
* **`Config.PrescriptionSettings`**: logical settings for prescriptions, including the item name and effects of specific drugs (speed, armor, health regeneration).
* **`Config.Map`**: Configuration for the live map, including hospital locations and vehicle types to track.
* **`Config.Dispatch`**: Settings for the dispatch system, including ignored jobs and alert history duration.

***

### Several services on one tablet (`Config.Jobs`)

One resource can serve more than one service, each with its own name, colour, ranks, society and radio codes. With a single job nothing changes and there is nothing to configure:

```lua
Config.Jobs = { ['ambulance'] = true }
```

To describe a service, replace `true` with a table. Every field is optional and falls back to the matching global setting, so you only write down what differs:

```lua
Config.Jobs = {
    ['ambulance'] = {
        primary = true,              -- owns every row written before more jobs were added
    },
    ['amr'] = {
        fractionName     = "AMR",
        fractionFullName = "American Medical Response",
        color            = { 250, 170, 20 },
        society          = { name = "society_amr", jobname = "amr", label = "AMR" },
        sharedWith       = { 'ambulance' },
    },
}
```

The full list of fields is documented above `Config.Jobs` in `config/config.lua` (name, colour, logo, `grades`, `requiredGrades`, `society`, `medics`, `billingLimits`, `bodyCam`, `dispatchUnits`, `vehicles`, `stations`, `sharedWith` and more).

{% hint style="warning" %}
Only the primary job inherits `Config.Society`. Every other job falls back to `society_<job>`, so it never pays into another service's account. A service whose ranks are not 0–4 needs its own `requiredGrades`.
{% endhint %}

`sharedWith` is directional: `['ambulance'] = { sharedWith = { 'amr' } }` lets ambulance see amr's medics on the list and the map, not the other way round. Set it on both sides for mutual visibility, or use `sharedWith = true` to see every job.

#### What is kept per job (`Config.PerJobData`)

```lua
Config.PerJobData = {
    announcements = true,
    radioCodes    = true,
    gallery       = true,
    auditLogs     = true,
    actionReports = true,

    dispatch      = false,
}
```

The modules set to `true` keep their rows per job; announcements, radio codes, gallery, audit log and action reports are kept apart per service. Patient records, deaths and medications are always shared: a patient is a patient whoever brought them in. With one job nothing changes, everything already in the database is handed to it on the first start.

`dispatch = false` is one shared dispatch for every job, which is how the tablet has always worked, and it defaults to `false` when the key is missing. Set it to `true` and each service gets its own calls, patrols, units and actions. Calls raised from the tablet or with the quick commands belong to the service that raised them; automatic alerts, the civilian line and calls from other resources stay visible to everyone. Patrols and boards follow `sharedWith` only when it is set on **both** sides.

### Dispatch

Everything below lives under `Config.Dispatch` in `config/config.lua`. Every option falls back to a default, so a config copied from an older version still runs.

#### Call life cycle

A call moves `new → accepted → on scene → closed`, and closing asks for a reason that stays in the archive. The card lists who took it and with which unit.

```lua
Lifecycle = {
    enabled = true,
    requireCloseReason = true,
    onlyAssignedCanClose = true,
    autoCloseAfter = 1800,   -- seconds of silence before an accepted call closes itself, 0 = never

    CloseReasons = { 'transported', 'treatedOnScene', 'deceased', 'refused', 'unfounded', 'duplicate' },
},
```

Reason labels come from the translations (`dispatchCloseReason<Name>`); a reason without a key shows its raw name.

#### Priorities

One priority drives the chip colour, the list order, the blip size on the map and the sound. The ambulance tablet ships `low`, `medium`, `high` and `critical`. `DefaultPriority = 'high'` is used for alerts that arrive without one.

```lua
Priorities = {
    ['low']    = { weight = 1, color = { 34, 197, 94 },  sound = 'alert.mp3', repeatSound = 1, volumeScale = 0.6, blipScale = 0.8 },
    ['medium'] = { weight = 2, color = { 234, 179, 8 },  sound = 'alert.mp3', repeatSound = 1, volumeScale = 0.8, blipScale = 0.9 },
    ['high']   = { weight = 3, color = { 249, 115, 22 }, sound = 'alert.mp3', repeatSound = 1, volumeScale = 1.0, blipScale = 1.1 },
    -- ...
},
```

`Emphasis` gives the alert types on its list the loudest treatment: a red frame on screen, a larger pin on the map and a marked card. On the ambulance tablet it holds `MedicPanic`. Keep the list short: it works because it is rare.

#### Creating a call from the tablet

```lua
CreateCall = {
    enabled = true,
    defaultPriority = 'high',
    cooldown = 10000,      -- ms between two calls from the same medic
    allowedGrades = {},    -- empty = anyone with a job from Config.Jobs
    allowMapPick = true,   -- pick the location on the live map
    Icons = { ... },
},
```

Grade limits are checked on the server as well, not only by hiding the button.

#### Callers, archive and quick keys

```lua
Calls = {
    callerInfo = true,       -- show who called (stripped on the server when false)
    allowAnonymous = true,
    attachments = true,      -- a photo on a call, https only
    attachmentHosts = {},    -- empty = any host
},

History = {
    enabled = true,
    keepDays = 14,           -- archived calls older than this are deleted, 0 = keep forever
    pageSize = 25,
    defaultSort = 'newest',
},

QuickActions = {
    enabled = true,
    accept  = { enabled = true, key = 'Z' },
    dismiss = { enabled = true, key = 'O' },   -- hides it for you only
    expand  = { enabled = true, key = 'J' },
},

SidebarBadge = {
    enabled = true,
    count = 'new',  -- 'new' = nobody took it yet, 'active' = every open call
},
```

Closed calls are archived in the database (created automatically) and can be searched by title, code and street, filtered by priority and reason. Quick keys act on the newest on-screen alert without opening the tablet.

#### Medic commands

```lua
MedicCommands = {
    enabled = true,

    panic = {
        enabled = true,
        command = 'medpanic',
        key = '',                  -- e.g. 'F9' to bind it
        code = '10-13',
        priority = 'critical',
        alertType = 'MedicPanic',
        cooldown = 30,
    },

    location = {
        enabled = true,
        command = 'medlocation',
        key = '',
        code = '10-20',
        priority = 'low',
        alertType = 'MedicLocation',
        cooldown = 20,
    },

    maxNoteLength = 128,
},
```

Both take an optional note. Name, badge and position are read on the server. The commands are prefixed (`/medpanic`, `/medlocation`) so they never clash with `/panic` and `/location` of the police tablet.

#### Civilian line — `/912`

```lua
CitizenCalls = {
    enabled = true,
    minLength = 4,
    maxLength = 200,
    anonymousKeyword = 'anon',

    Lines = {
        {
            enabled = true,
            command = '912',            -- /912 <what happened>
            code = '912',
            priority = 'high',
            icon = 'fa-phone-volume',
            alertType = 'CitizenCall',

            targetJob = nil,             -- nil = every call board sees it
            forwardTo = {},              -- other QF tablets that get a copy, e.g. { 'qf_mdt_police_v2' }

            cooldown = 120,              -- seconds between two calls from the same person
            maxPerSession = 0,
            duplicateWindow = 600,
            nearbyRadius = 60.0,         -- calls close together count as one event
            nearbyWindow = 90,

            anonymous = false,
            allowAnonymousFlag = true,
            blockedJobs = {},
        },
    },
},

SiblingMDTs = { 'qf_mdt_police_v2', 'qf_mdt_mechanic_v2', 'qf_mdt_doj_v2' },
```

Every entry in `Lines` is a separate command with its own code, priority and anti-spam counters. `forwardTo` sends a copy to other QF tablets, so one number can dispatch two services at once. A caller may stay anonymous with `/912 anon <what happened>`.

{% hint style="warning" %}
One command belongs to exactly one tablet. The QF tablets use `/911` police, `/912` ambulance, `/913` mechanic and `/914` DOJ. The tablets listed in `SiblingMDTs` are checked on start and a command registered twice is printed in the server console. If your phone already provides the number, turn the line off and connect the phone to `CreateCitizenCall`.
{% endhint %}

***

### Exports (Server-side) <a href="#user-content--exports-server-side" id="user-content--exports-server-side"></a>

#### `AddLog` <a href="#user-content-addlog" id="user-content-addlog"></a>

Adds a new entry to the audit log system. This is useful for logging actions from other scripts into the MDT.

**Parameters:**

* `source` (number|nil): The player source ID. If `nil`, it is logged as "System".
* `tag` (string): The category tag for the log (e.g., "Admission", "Prescription", "Hospital").
* `text` (string): The main content of the log message.
* `color` (string): The color tag for the entry. Supported: `"blue"`, `"red"`, `"green"`, `"orange"`, `"black"`.
* `fields` (table|nil): Key-value pairs of additional data to store (e.g., `{ patient = "Name", amount = 500 }`).
* `args` (table|nil): Arguments for translation placeholders if `text` is a translation key.

**Return:** `void`

**Example:**

```lua
-- Log a patient admission

exports.qf_mdt_ambulance_v2:AddLog(    
    source,     
    "New Patient",     
    "Admitted John Doe to the hospital",     
    "blue",     
    {         
        patient = "John Doe",         
        reason = "Fractured Arm",         
        room = "204"     
    }
)
```

***

#### `CreateCall`

Raises a call on the dispatch board from another resource. Everything except the title and the coordinates is optional.

```lua
local id = exports.qf_mdt_ambulance_v2:CreateCall({
    title       = 'Cardiac arrest',
    coords      = vector3(425.1, -979.5, 30.7),
    code        = '10-52',
    description = 'Man collapsed outside the gym, not breathing',
    priority    = 'high',
    icon        = 'fa-heart-pulse',
    job         = 'ambulance',     -- only this job sees it, with Config.PerJobData.dispatch = true
})
```

Returns the id of the call, or `nil` when a free zone or the deduplication window dropped it.

#### `CreateCitizenCall`

Raises a call on behalf of a player who has no tablet, for example from a phone app. Coordinates default to the player's position. To show the caller's phone number, add `EDITABLE.GetPhoneNumber(xPlayer)` returning it to `config/server/editable.lua` (the same function as in the Police MDT \[V2]); it is not asked for anonymous calls.

```lua
exports.qf_mdt_ambulance_v2:CreateCitizenCall(playerSource, {
    title       = 'Emergency call',
    description = 'Man collapsed outside the gym, not breathing',
    priority    = 'high',
    anonymous   = false,
})
```

#### `CloseCall`

Closes an active call and writes it to the archive.

```lua
exports.qf_mdt_ambulance_v2:CloseCall(id, 'transported')
```

#### Other server exports

| Export                                                           | Description                                                                      |
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `GetMedicBadge(identifier)` / `SetMedicBadge(identifier, badge)` | Reads or sets a medic's badge number.                                            |
| `GetMedicHours(identifier)`                                      | Hours on duty.                                                                   |
| `RefreshMedic(identifier)`                                       | Rereads badge, grade and radio of an online medic.                               |
| `GetFineCatalogue()`                                             | The invoice list, read by Banking V2 when the tablet is first switched on there. |

***

### Exports (Client-side) <a href="#user-content--exports-client-side" id="user-content--exports-client-side"></a>

#### `CreateDispatchAlert` <a href="#user-content-createdispatchalert" id="user-content-createdispatchalert"></a>

Creates a dispatch alert that appears on the MDT map and list for on-duty medics.

**Parameters:**

* `coords` (vector3): The world coordinates of the alert.
* `title` (string): The title of the alert (e.g., "Cardiac Arrest", "Injured Person").
* `description` (string): A detailed description of the incident.
* `code` (string): The dispatch code (e.g., "10-13", "10-99").
* `colorRGB` (table): A table `{r, g, b}` representing the alert color.
* `maxMedics` (number): The maximum number of units that can attach to this alert.
* `duration` (number): How long (in ms) the alert stays active.

**Return:** `void`

**Example:**

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

exports.qf_mdt_ambulance_v2:CreateDispatchAlert(    
    playerCoords,    
    "Car Accident",    
    "Reported vehicle collision with injuries",    
    "10-50",    
    { 255, 165, 0 },   
    3,  
    15000
)
```

#### `showBodycam` <a href="#user-content-showbodycam" id="user-content-showbodycam"></a>

Forces the Bodycam UI to become visible.

**Example:**

```lua
exports.qf_mdt_ambulance_v2:showBodycam()
```

#### `hideBodycam` <a href="#user-content-hidebodycam" id="user-content-hidebodycam"></a>

Forces the Bodycam UI to hide.

**Example:**

```lua
exports.qf_mdt_ambulance_v2:hideBodycam()
```

#### `toggleBodycam` <a href="#user-content-togglebodycam" id="user-content-togglebodycam"></a>

Toggles the current state of the Bodycam UI.

**Example:**

```lua
exports.qf_mdt_ambulance_v2:toggleBodycam()
```

#### `showMedicBadge` <a href="#user-content-showmedicbadge" id="user-content-showmedicbadge"></a>

Displays the medic badge card on the screen.

**Parameters:**

* `data` (table): A table containing the badge details.
  * `name` (string): The name displayed on the badge.
  * `gradeLabel` (string): The rank or title.
  * `badge` (string): The badge number.
  * `mugshot` (string): URL to the image or base64 string.
  * `duration` (number): Time in ms to display the badge.
  * `licenses` (table): List of licenses `{ {label="Driver", active=true}, ... }`.

**Example:**

```lua
exports.qf_mdt_ambulance_v2:showMedicBadge(
    {    
        name = "Dr. House",    
        gradeLabel = "Chief of Medicine",    
        badge = "001",    
        mugshot = "https://example.com/house.jpg", -- or Base64    
        duration = 5000,    
        licenses = {        
            { label = "Medical License", active = true },        
            { label = "Driver License", active = true }    
        }
    }
)
```

#### `GetMugShotBase64` <a href="#user-content-getmugshotbase64" id="user-content-getmugshotbase64"></a>

Captures a mugshot of the specified ped and returns it as a Base64 string.

**Parameters:**

* `Ped` (entity): The ped handle to capture.
* `Transparent` (boolean): If `true`, attempts to remove the background (requires game support).

**Return:**

* `string`: The Base64 encoded image.

**Example:**

```lua
local ped = PlayerPedId()
local base64 = exports.qf_mdt_ambulance_v2:GetMugShotBase64(ped, false)

print("Captured mugshot length:", #base64)
```

***

### Events <a href="#user-content--events" id="user-content--events"></a>

#### Client Events <a href="#user-content-client-events" id="user-content-client-events"></a>

**`qf_mdt_ambulance_v2:client:openPharmacy`**

Opens the pharmacy prescription redemption menu. This can be used by third-party target systems or interaction scripts.

**Usage:**

```lua
TriggerEvent('qf_mdt_ambulance_v2:client:openPharmacy')
```

### Dispatch Integrations & Custom Alerts

#### Compatibility

Enable 3rd party script compatibility by editing `config/config.lua`.

```lua
-- Enable external dispatch scripts in config/config.lua
Config.Dispatch = {
    Integration = {
        rcore_dispatch = true, -- Set to true to automatically bridge alerts
        core_dispatch = false,
        opto_dispatch = false,
        tk_dispatch = false
    }
}
```

#### Custom Alerts

Control and send dispatch alerts to the MDT programmatically.

```lua
-- Send a custom dispatch alert manually from any server script
TriggerEvent('qf_mdt_ambulance_v2/server/addCustomDispatch', {
    id = "custom_alert_123",          -- (Optional) Unique ID, system generates one if empty
    title = "Injured Person",         -- Alert title/name
    code = "10-90",                   -- Dispatch code
    color = {255, 0, 0},              -- RGB color table or HEX string (e.g., "#FF0000")
    street = "Route 68",              -- (Optional) Street name or location description
    x = 100.5,                        -- X coordinate of the alert
    y = -213.2,                       -- Y coordinate of the alert
    z = 32.5,                         -- Z coordinate of the alert
    max_medics = 6,                   -- (Optional) Maximum medics that can react (default: 10)
    duration = 5000                   -- (Optional) Duration the alert stays on screen in ms (default: 5000)
})
```

## QF Banking V2 Billing (`Config.Integrations`)

The tablet can use the billing of our [Banking \[V2\]](https://wiki.qfdevelopers.com/scripts/banking-v2.md) as the place where its invoice list lives and where its bills are issued and paid. It is **off by default**; without it nothing changes.

1. In the bank: **Admin → Billing → Service tablets**, switch on **ambulance**, pick its billing faction (your `ambulance` job) and keep the resource name `qf_mdt_ambulance_v2`. On the first switch-on the bank copies `Config.InvoiceList` (export `GetFineCatalogue`; the Prescriptions group is copied too, as a billable list) into the faction's tariff.
2. In `config/config.lua`:

```lua
Config.Integrations = {
    QFBanking = { enabled = true, resource = 'qf_banking_v2' },
}
```

While both are on:

* the "New invoice" list is the bank's invoice tariff, refreshed in open tablets when it is edited in the bank,
* an invoice is issued as a bank invoice priced by the bank's tariff on the server. Custom charges are sent as custom lines, accepted when the faction allows them in the bank. `Config.Billings` is not used for these invoices. Prescriptions are still saved and handed over as an item, and a prescription is never billed,
* the citizen's invoices show the bank's status (awaiting acceptance, unpaid, paid, rejected, canceled) and refresh when the bill is paid, closed or overdue,
* deleting or clearing invoices cancels their open bank bills first. Paid bills stay paid.

{% hint style="info" %}
If the bank is stopped or the tablet is switched off there, the MDT goes back to its own list and `Config.Billings`. Every bank call is protected, so a bank restart never breaks the tablet.
{% endhint %}

## Resetting Medic Hours <a href="#user-content-5-resetting-medic-hours-ambulance" id="user-content-5-resetting-medic-hours-ambulance"></a>

The Ambulance MDT tracks on-duty hours for all medical personnel. To clear these hours (e.g., at the end of a month), you can trigger the internal server callback. The requester must be on-duty and authorized to perform this action.

* **Callback Name:** `qf_mdt_ambulance_v2/resetMedicHours`
* **Target Identifier:** `id` (Character Identifier / CitizenID / License)

```lua
local medicId = "MEDIC_001"

CALLBACK.TriggerServerCallback('qf_mdt_ambulance_v2/resetMedicHours', function(result)
    if result.success then
        print("Medic hours have been reset successfully.")
    else
        print("Error: " .. result.error)
    end
end, medicId)
```

## Duty Status Change Hook <a href="#user-content-7-duty-status-change-hook-ambulance" id="user-content-7-duty-status-change-hook-ambulance"></a>

Similar to the Police MDT, the Ambulance MDT includes a hook for medic status changes. This allows you to run custom server-side logic whenever a medic toggles their availability or is kicked from duty by a supervisor.

* **Location:** `config/server/editable.lua`
* **Function:** `EDITABLE.OnStatusChange(source, status)`

**Usage Example**

You can use this to keep the player's job state in sync with the MDT interface:

```lua
function EDITABLE.OnStatusChange(source, status)
    -- Triggered for status: "available", "unavailable"
    
    if status == "available" then
        -- Example: Triggering a custom onDuty event
        TriggerEvent('exampleambulancejob:onDuty', source)
    elseif status == "unavailable" then
        -- Example: Triggering a custom offDuty event
        TriggerEvent('exampleambulancejob:offDuty', source)
    end
end
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.qfdevelopers.com/scripts/editor-5/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
