> For the complete documentation index, see [llms.txt](https://x19-development.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://x19-development.gitbook.io/docs/assets-and-usage/notify/installation-and-usage-guide.md).

# Installation & Usage Guide

## Installation

1. Download the resource,
2. Extract to your resources folder,
3. Add `ensure X19-Notify` to your server.cfg,
4. Configure in config.lua,
5. Follow `How to use the notification` in `README.md`,

## Notification Usage:

#### Client side:

```lua
exports['X19-Notify']:SendNotify(Title, Type, Time, Caption)
```

#### Server side:

```lua
TriggerClientEvent('x19-Notify:SendNotify', source, Title, Type, Time, Caption)
```

### Add Custom Types

#### You can add more Types easily in Config.VariantDefinitions <a href="#you-can-add-more-types-easily-in-config.variantdefinitions" id="you-can-add-more-types-easily-in-config.variantdefinitions"></a>

```lua
Config.VariantDefinitions = {
    success = {
        icon = 'fas fa-check',
        color = "#47cf73", -- Green
    },
    primary = {
        icon = 'fas fa-info',
        color = "#1c75d2", -- Blue
        sound = "sound.mp3", -- Optional sound file
        volume = 0.3, -- Optional volume for the sound
    },
    error = {
        icon = 'fas fa-xmark',
        color = "#dc3545", -- Red
    },
    warnning = {
      icon = "fas fa-exclamation",
      color = "#FFB300", -- Yellow
    },
    police = {
        icon = 'local_police',
        color = "#0D54C8", -- Blue
    },
    ambulance = {
        icon = 'fas fa-ambulance',
        color = "#f44236", -- Red
    }
}
```

### Example of Usage

Example of how to use it in the qb-core :\
goto  qb-core\client\functions.lua

```lua
function QBCore.Functions.Notify(text, texttype, length)
    if type(text) == "table" then
        local ttext = text.text or 'Placeholder'
        local caption = text.caption or 'Placeholder'
        texttype = texttype or 'primary'
        length = length or 5000

        exports['X19-Notify']:SendNotify(ttext, texttype, length, caption)
    else
        texttype = texttype or 'primary'
        length = length or 5000

        exports['X19-Notify']:SendNotify(text, texttype, length)
    end
end
```
