> For the complete documentation index, see [llms.txt](https://bsensei-script.gitbook.io/bsensei-script-documentation-officiel-fivem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bsensei-script.gitbook.io/bsensei-script-documentation-officiel-fivem/metiers-and-missions/editor/systeme-de-notifications.md).

# Systeme de notifications

## 🔔 Systèmes de notifications

Le script **BSensei EMS** inclut un fichier dédié à la gestion des notifications (`notify.lua`).\
Ce système te permet de choisir facilement le type d’alerte que tu veux afficher en jeu.

Tu peux utiliser :

* **ox\_lib** → moderne, intégré, fluide
* **okokNotify** → design coloré, très populaire
* **ESX Notify** → classique, léger
* **Custom** → ton propre système

***

### ⚙️ Localisation du fichier

Le fichier de configuration se trouve ici :

```plaintext
bsensei_ems/notify.lua
```

### 🧱 Structure du fichier `notify.lua`

```lua
function Notify(type, message)
    if Config.NotifySystem == "ox" then
        lib.notify({
            title = "BSensei EMS",
            description = message,
            type = type
        })
    elseif Config.NotifySystem == "okok" then
        exports['okokNotify']:Alert("BSensei EMS", message, 5000, type)
    elseif Config.NotifySystem == "esx" then
        ESX.ShowNotification(message)
    else
        print("[BSensei EMS] Notification:", message)
    end
end
```

***

Ce fichier est appelé à chaque fois que le script veut envoyer un message (alerte mission, succès, erreur, etc.).

***

### 💬 Types de notifications disponibles

| Type      | Description         | Exemple visuel                 |
| --------- | ------------------- | ------------------------------ |
| `success` | Message de réussite | ✅ Mission terminée avec succès |
| `error`   | Message d’erreur    | ❌ Aucun patient trouvé         |
| `info`    | Information neutre  | ℹ️ Nouvelle mission disponible |

💡 *Les types sont identiques entre ox\_lib, okokNotify et ESX, donc aucun besoin d’adapter le code.*

***

### 🧩 Choisir ton système de notification

La sélection se fait directement dans le fichier `config.lua` :

```lua
Config.NotifySystem = "ox"  -- ou "okok", "esx"
```

#### 🪄 Exemples :

* Pour utiliser **ox\_lib** :

  ```lua
  Config.NotifySystem = "ox"
  ```
* Pour utiliser **okokNotify** :

  ```lua
  Config.NotifySystem = "okok"
  ```
* Pour utiliser le système **ESX natif** :

  ```lua
  Config.NotifySystem = "esx"
  ```

***

### 🧠 Ajouter ton propre système de notification

Tu veux utiliser ton propre style ?\
C’est simple : ajoute un `elseif` dans le fichier `notify.lua`.

#### Exemple pour intégrer un système custom :

```lua
elseif Config.NotifySystem == "mythic" then
    exports['mythic_notify']:SendAlert(type, message, 5000)
```

Ensuite, mets dans ta config :

```lua
Config.NotifySystem = "mythic"
```

✅ Et c’est tout. Le script utilisera ton système sans autre modification.

***

### 🚨 En cas de problème

Si tu ne vois **aucune notification en jeu**, vérifie :

* Que `Config.NotifySystem` correspond bien à un système installé sur ton serveur
* Que la ressource concernée (`okokNotify`, `ox_lib`, etc.) est **démarrée avant `bsensei_ems`**
* Que ton fichier `notify.lua` n’a pas été renommé ou déplacé

***

<p align="center">➡️ Étape suivante : Dépendance nécessaire</p>


---

# 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://bsensei-script.gitbook.io/bsensei-script-documentation-officiel-fivem/metiers-and-missions/editor/systeme-de-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.
