> 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/additional-informations.md).

# Additional Informations

Page dedicated to Additional Informations about our Ambulance MDT \[V2]

### Installation Guide <a href="#user-content--installation-guide" id="user-content--installation-guide"></a>

#### 1. Requirements <a href="#user-content-1-requirements" id="user-content-1-requirements"></a>

Ensure you have the following dependencies installed and started **before** the MDT:

* `ox_lib` (Latest version)
* `oxmysql`
* `es_extended` OR `qb-core` OR `qbx_core`
* `ox_target` OR `qb-target` (if you want target interactions)

#### 2. Database Setup <a href="#user-content-2-database-setup" id="user-content-2-database-setup"></a>

1. Locate the `.sql` file provided with your download.
2. Import it into your server's database (e.g., using HeidiSQL or phpMyAdmin).
   * *Note: This script requires specific tables such as `qf_mdt_ambulance_radio_codes` to function.*

#### 3. Inventory Setup (Ox Inventory) <a href="#user-content-3-inventory-setup-ox-inventory" id="user-content-3-inventory-setup-ox-inventory"></a>

If you are using `ox_inventory`, add the following items to your `data/items.lua` (or `ox_inventory/data/items.lua`):

*Ensure you also copy the images to the inventory's `web/images/` directory.*

***

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

#### Adding a New Drug <a href="#user-content-adding-a-new-drug" id="user-content-adding-a-new-drug"></a>

To add a new medication, you must update two sections in

config/config.lua:

**Step 1: Define the Item and Effect** In `Config.PrescriptionSettings.medications`:

```lua
{     
    item = "tramadol",          -- Item name in inventory    
    label = "Tramadol",         -- Label in menus    
    type = "health",            -- Effect type: 'health', 'armor', or 'speed'    
    amount = 15,                -- Amount of health/armor restored    
    animDict = "mp_suicide",    
    anim = "pill",    
    flags = 49
}
```

**Step 2: Define Dosage Rules** In `Config.NUI.medications`:

```lua
{ 
    name = "Tramadol", 
    dosageRate = 2, 
    unit = "mg" 
}
```

**Step 3: Define Medical Protocols** In `Config.NUI.medProtocols`:

```lua
['Tramadol'] = {    
    maxSafeDose = 400.0,    
    description = "Opioid pain medication.",    
    sideEffects = "Nausea, dizziness",    
    contraindications = "Alcohol use, respiratory problems"
}
```

#### Adding a New Hospital <a href="#user-content-adding-a-new-hospital" id="user-content-adding-a-new-hospital"></a>

To add a new hospital location to the map, add an entry to `Config.Map.Hospitals`:

```lua
{    
    id = "custom_hospital",                 -- Unique ID    
    name = "Custom Memorial Hospital",      -- Display Name    
    position = {123.45, -678.90},           -- Coordinates {x, y}    
    radius = 60.0,                          -- Zone radius    
    street = "Custom Street",               -- Street name    
    thumbnailUrl = "img/map/hospitals/custom.webp" -- Path to image in web/build folder
}
```

#### Customizing Colors <a href="#user-content-customizing-colors" id="user-content-customizing-colors"></a>

You can change the primary theme color in `Config.NUI.primaryColor`. Use an RGB table format:

```luau
primaryColor = ParseRGB({ 0, 122, 255 }) -- Blue theme
```

*Note: Some parts of the UI (specifically HSL values in audit logs) might need separate manual adjustments if you drastically change the theme.*

***

### Localization (Adding Languages) <a href="#user-content--localization-adding-languages" id="user-content--localization-adding-languages"></a>

1. Navigate to `config/translations/`.
2. Duplicate `en.lua` and rename it (e.g., `es.lua` for Spanish).
3. Open the file and change the code at the top:

   ```lua
   TRANSLATIONS['es-ES'] = {    
       code = "es-ES",    
       currency = "USD",
   }
   ```
4. Open `config/config.lua` and update `Config.NUI.langs` to include your new language:

   <pre class="language-lua"><code class="lang-lua"><strong>{    
   </strong>    code = "es-ES",    
       name = "Español",    
       iconUrl = "URL_TO_FLAG_ICON"
   }
   </code></pre>
5. Set `Config.Locale = "es-ES"` to make it default.

***

### Troubleshooting (FAQ) <a href="#user-content--troubleshooting-faq" id="user-content--troubleshooting-faq"></a>

#### 1. "The MDT won't open!" <a href="#user-content-1-the-mdt-wont-open" id="user-content-1-the-mdt-wont-open"></a>

* **Check Job**: Ensure your player has the `ambulance` job (or whatever is configured in `Config.Jobs`).
* **Check Keybind**: Press `DELETE` (default). Check `F8` console for errors.
* **Check Resource State**: Ensure the resource is strictly named `qf_mdt_ambulance_v2` if the code references it by name.

#### 2. "I can't see any items in the Pharmacy/Prescriptions." <a href="#user-content-2-i-cant-see-any-items-in-the-pharmacyprescriptions" id="user-content-2-i-cant-see-any-items-in-the-pharmacyprescriptions"></a>

* **Check Inventory**: Ensure `ox_inventory` is started and the items are added to `data/items.lua`.
* **Check Console**: Note any errors related to "Item not found".

#### 3. "Database errors in console." <a href="#user-content-3-database-errors-in-console" id="user-content-3-database-errors-in-console"></a>

* **Import SQL**: Confirm you imported the provided `.sql` file.
* **MySQL Connection**: Ensure `oxmysql` is connected and working for other resources.

#### 4. "Images are broken." <a href="#user-content-4-images-are-broken" id="user-content-4-images-are-broken"></a>

* **Mugshots**: Mugshots require a valid heavy-duty hosting or accurate Discord webhook if modified.
* **Inventory Images**: Move the images from the script's `img` folder (if provided) to your inventory's image directory.

#### 5. "I can't fire/hire medics." <a href="#user-content-5-i-cant-firehire-medics" id="user-content-5-i-cant-firehire-medics"></a>

* **Permissions**: Ensure your character has a high enough grade in the database.
* **Config Check**: Check `Config.NUI.requiredGrades` to see what grade level is required for those actions.


---

# 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/additional-informations.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.
