# Setup and Database

This page covers the minimum setup required to get `0r-ambulancejob` running correctly.

## Required Dependencies

* [oxmysql](https://github.com/overextended/oxmysql/releases)
* [ox\_lib](https://github.com/overextended/ox_lib/releases)
* `0r_lib`
* ESX, QBCore, or Qbox framework

## Optional Dependencies

These resources are optional, but recommended for the shipped ambulance vehicle and assistive flows:

* `emsprops`
* `iak_wheelchair`
* `qua_ambulance_int`

If you do not use them, disable or replace the related actions in `config/hotbar.lua` and the ambulance vehicle settings.

## Recommended server.cfg Start Order

```cfg
ensure oxmysql
ensure ox_lib

ensure framework
ensure 0r_lib

ensure [ambulance-job]
```

Use the correct framework resource name for your server, such as `es_extended`, `qb-core`, or `qbx_core`.

## Database Setup

Import the SQL before first start. It will be generated automatically by the script, but you can also execute it manually in case of any problems.

{% content-ref url="/pages/arRnnfdsNTlR4P4iiumo" %}
[Database SQL](/0resmon/0r-resources/0r-ambulancejob/setup-and-database/database.sql.md)
{% endcontent-ref %}

The SQL creates these facility persistence tables:

* `0resmon_ambulance_facilities`
* `0resmon_ambulance_staff_roster`
* `0resmon_ambulance_facility_logs`
* `0resmon_ambulance_facility_accounts`
* `0resmon_ambulance_facility_account_transactions`
* `0resmon_ambulance_facility_invoices`
* `0resmon_ambulance_facility_permission_overrides`

## Local Setup Checklist

* Import `read-me/database.sql` into your database.
* Review every file in `config/*.lua`.
* Add the required inventory items from `items.md`.
* If `Config.facility.panel.openWithItem.active = true`, create the configured panel item.
* Create the item configured by `Config.facility.runtime.medBag.item` if you use the med bag flow.
* Set `Config.inventoryImagesFolder` so treatment item icons can load from your inventory image path.
* Review `config/hotbar.lua` and disable actions that rely on optional resources you do not run.
* Keep hotbar UI icons in `ui/build/items` aligned with the `image` values used in `config/hotbar.lua`.

## Localization

The resource loads its locale from `Config.locale` in `config/init.lua`.

```lua
Config = {
    locale = "en",
}
```

Locale files live in `locales/*.json`.

## Admin Commands

The default command names are configured in `config/init.lua`.

* `/911e`: alert EMS
* `/revive`: admin revive
* `/kill [id] [laststand]`: force a player into dead or laststand state
* `/revivep`: revive nearest player
* `/medtest [state]`: start an admin treatment panel self-test
* `/hotbar_assistive_debug [values]`: tune active assistive equipment offset / rotation

`/kill` marks all body regions as fatal by default. If the optional `laststand` argument is used, the target is forced into laststand instead.

`/hotbar_assistive_debug` is controlled by `Config.commands.hotbarAssistiveDebug` and is restricted to `group.admin` by default.


---

# Agent Instructions: 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:

```
GET https://docs.0resmon.org/0resmon/0r-resources/0r-ambulancejob/setup-and-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
