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!'
}
-- Example with header as image (url)
local data = {
header = 'https://r2.fivemanage.com/9fHGnEBEfnR89IeQ0njaD/Vector4.png',
text = 'My default notification with image!'
}
header
String / Object Icon of the default notification.
text
String Text of the default notification.
progress
Object Creates progress instead of text. Check example below.
persistent
Boolean Sets default notification as persistent. You need to remove it later manually!
Header object
text
String Text before the icon
color
HEX Hex color of the icon
icon
Icon Icon of the header object. List of icons.
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