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:

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

Server side:

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

Add Custom Types

You can add more Types easily in Config.VariantDefinitions

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

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

Last updated