Qbox
Last updated
Last updated
---@see client.lua:Notify.Show
function Notify(source, text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor)
local title, message
-- Normalize text input
if type(text) == 'table' then
title = text.text or 'Notification'
message = text.caption or ''
elseif subTitle then
title = text
message = subTitle
else
title = 'Notification'
message = text
end
-- Build nm1-compatible payload
local data = {
title = title,
message = message,
type = notifyType or 'info',
duration = duration or 5000,
theme = notifyStyle or 'dark'
}
-- Optional position override
if notifyPosition then
data.position = notifyPosition
end
TriggerClientEvent('nm1_notification:client:show', source, data)
end
exports('Notify', Notify)---@see client.lua:Notify.Show
function Notify(source, text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor)
local title, message
-- Normalize text input
if type(text) == 'table' then
title = text.text or 'Notification'
message = text.caption or ''
elseif subTitle then
title = text
message = subTitle
else
title = 'Notification'
message = text
end
-- Build nm1-compatible payload
local data = {
title = title,
message = message,
type = notifyType or 'info',
duration = duration or 5000,
theme = notifyStyle or 'dark'
}
-- Optional position override
if notifyPosition then
data.position = notifyPosition
end
TriggerClientEvent('nm1_notification:client:show', source, data)
end
exports('Notify', Notify)