ESX
Last updated
es_extended/client/functions.lua [Search function ESX.ShowNotification ]
Last updated
---@param message string The message to show
---@param notifyType? string The type of the notification
---@param length? number The length of the notification
---@param title? string The title of the notification
---@param position? string The position of the notification
---@return nil
function ESX.ShowNotification(message, notifyType, length, title, position)
local typeMap = {
[0] = 'info',
[1] = 'success',
[2] = 'error',
[3] = 'warning',
}
local resolvedType = typeMap[notifyType] or notifyType or 'info'
local success = pcall(function()
exports['nm1-classynotify']:Notify({
type = resolvedType,
message = message,
title = title,
duration = length or 5000,
position = position or 'top-right'
})
end)
if not success then
print('^1[nm1-classynotify]^7 Failed to send notification. Is the resource started?')
end
end