> For the complete documentation index, see [llms.txt](https://ambr4-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ambr4-scripts.gitbook.io/docs/scripts/report-system/general-installation.md).

# General Installation

1. Put the folder in your server resources, for example:
   * resources/\[ambr4]/ambr4\_ticket

2. Keep folder name as ambr4\_ticket.

3. Import:

   * ambr4\_ticket.sql in your database.
   * Note: the script also auto-creates/migrates tables on startup if DB permissions are correct.

4. Configure config.lua file

Set these values:

```lua
Config.Framework = "esx"    -- "esx", "qbcore", or "qbox"
Config.Inventory = "ox"     -- "ox", "esx", or "qb"

Config.AdminGroups = {
    admin = true,
    mod = true,
    superadmin = true,
    god = true
}

Config.Command = "tickets"
Config.OpenKey = "f7"
Config.Locale = "en"

Config.UseDiscordAvatars = true
Config.DiscordBotToken = ""         -- set your bot token or leave empty/disable avatars
Config.EnableDiscordWebhooks = true
Config.DiscordWebhookUrl = ""       -- optional

```

Important:

{% hint style="warning" %}
Replace/remove any test tokens/webhooks before release.

For QBCore/Qbox, ensure your permission/group names are included in Config.AdminGroups.
{% endhint %}

&#x20;5\. Add to server.cfg (start order matters)

Use the correct order for your framework.

Example ESX:

```lua
ensure oxmysql
ensure es_extended
ensure ox_inventory    # if you use Config.Inventory = "ox"
ensure ambr4_ticket
```

Example QBCore:

```lua
ensure oxmysql
ensure qb-core
ensure ox_inventory    # if you use Config.Inventory = "ox"
ensure ambr4_ticket
```

Example Qbox:

```lua
ensure oxmysql
ensure qbx_core
ensure ox_inventory    # if you use Config.Inventory = "ox"
ensure ambr4_ticket
```

&#x20;6\. Start server, or run:

* ensure ambr4\_ticket

&#x20;7\. First-run validation checklist:

* Open game and run /tickets (or press F7).
* Create a test ticket.
* Confirm ticket appears in Active tab.
* Confirm message sending works.
* Confirm DB rows appear in:
  * ambr4\_tickets
  * ambr4\_ticket\_messages
* If admin account is configured, confirm admin actions and ratings panel visibility.
* If Discord enabled, confirm avatar/webhook behavior.

### Dependencies

<details>

<summary><a href="https://github.com/overextended/oxmysql">oxmysql</a></summary>

\
oxmysql is required. It handles all SQL operations for tickets, messages, ratings, audit logs, and image storage. Make sure it starts before `ambr4_ticket`.

</details>

<details>

<summary><a href="https://github.com/overextended/ox_lib">ox_lib</a></summary>

ox\_lib is utilized for its optimized and useful functions alongside its responsive interface options.

</details>

<details>

<summary><a href="https://github.com/esx-framework/esx_core/tree/main/[core]/es_extended">es_extended</a> or <a href="https://github.com/qbcore-framework/qb-core">qb-core</a> or <a href="https://github.com/Qbox-project">qbox</a></summary>

This script is compatible with ESX, qb-core and Qbox, offering flexibility and compatibility for various server setups.

</details>


---

# 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://ambr4-scripts.gitbook.io/docs/scripts/report-system/general-installation.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.
