> For the complete documentation index, see [llms.txt](https://wxn-studios.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wxn-studios.gitbook.io/documentation/fivecraft-scripts/weapon-repairs/installation/notifications.md).

# Notifications

This resource includes a built-in wrapper system to handle notifications across different frameworks (ESX, QBCore, Ox) without requiring you to edit the core logic.

## Configuration

In `shared/sh_config.lua`, you can set the `Config.Notify` variable:

{% code title="shared/sh\_config.lua" %}

```lua
Config.Notify = 'ox' -- Options: 'ox', 'esx', 'qb', 'custom'
```

{% endcode %}

### Options

| Option   | Description                               | Requirements                       |
| -------- | ----------------------------------------- | ---------------------------------- |
| `ox`     | Uses **ox\_lib** notifications (Default). | `ox_lib` resource                  |
| `esx`    | Uses **ESX** native notifications.        | `es_extended` resource             |
| `qb`     | Uses **QBCore** native notifications.     | `qb-core` resource                 |
| `custom` | Uses your own custom logic.               | Edit `client/cl_notifications.lua` |

## Custom Notifications

If you use a standalone notification system (like `mythic_notify`, `okokNotify`, etc.), follow these steps:

{% stepper %}
{% step %}

### Step 1

Set `Config.Notify = 'custom'` in `shared/sh_config.lua`.
{% endstep %}

{% step %}

### Step 2

Open `client/cl_notifications.lua`.
{% endstep %}

{% step %}

### Step 3

Locate the `elseif Config.Notify == 'custom' then` block inside the `Notify` function.
{% endstep %}

{% step %}

### Step 4

Add your custom export or event trigger.
{% endstep %}
{% endstepper %}

### Example: Using Mythic Notify

{% code title="client/cl\_notifications.lua (excerpt)" %}

```lua
elseif Config.Notify == 'custom' then
    if type == 'success' then
        exports['mythic_notify']:DoHudText('success', msg)
    elseif type == 'error' then
        exports['mythic_notify']:DoHudText('error', msg)
    else
        exports['mythic_notify']:DoHudText('inform', msg)
    end
```

{% endcode %}

{% hint style="info" %}
The notification logic is isolated in `client/cl_notifications.lua`. This file is loaded *after* `cl_utils.lua` but *before* the main interaction scripts, ensuring the `Notify` function is available globally.
{% endhint %}

## Function Signature

{% code title="client/cl\_notifications.lua (Notify signature)" %}

```lua
---@param type string 'success' | 'error' | 'info'
---@param message string Locale key or direct text
---@param ... any Optional format arguments for the string
function Notify(type, message, ...)
```

{% endcode %}


---

# 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://wxn-studios.gitbook.io/documentation/fivecraft-scripts/weapon-repairs/installation/notifications.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.
