Default Notifications

The notification system is designed to display messages that pop up above the minimap, ensuring they are noticeable and non-intrusive during gameplay.

Add

In order to add default notification you can use the export:

local serial = exports['ZSX_UIV2']:DefaultNotification(data)

Data is an object that contains:

-- Example with header
local data = {
    header = 'fas fa-envelope',
    text = 'My default notification'
}
-- Example without header
local data = {
    text = 'My default notification'
}

local data = {
    header = {
            text = 'RESPECT',
            color = "#ee1c3e",
            icon = 'fas fa-chevron-down'
    },
    text = 'Your respect is low!'
}
Key
Value
Optional

header

String / Object Icon of the default notification.

text

String Text of the default notification.

progress

persistent

Boolean Sets default notification as persistent. You need to remove it later manually!

Header object

key
value
Optional

text

String Text before the icon

color

HEX Hex color of the icon

icon

The export returns a serial, which can be useful if you need to remove it later.

Remove

To remove a notification before its time elapses, you need to retrieve the serial from the previously added notification. Use this serial to identify and remove the notification.

exports['ZSX_UIV2']:DefaultNotification_Remove(serial)

Progress

To create default notification as progress, you can use the following example:

local data = {
    header = 'Engine',
    progress = { value = 10 },
}

Last updated