dispatchNotification
exports.drx_dispatch:dispatchNotification(...)
TriggerEvent('drx_dispatch:client:dispatchNotification', ...)
---@class Notification
---@field type? 'create' | 'info' | 'success' | 'error' | 'warning' Type of notification, defaults to 'create'
---@field title string Title of the notification
---@field description string | {callsign: string, department: number, rank: number} The description of the notification
---@field content string | table<{icon: string, text: string}> The content of the notification
---@field meta? string The meta of the notification
---@field closable? boolean Whether the notification is closable or not, defaults to true
---@field duration? number The duration of the notification, defaults to 5000
function Notification.dispatchNotification()
local data = {
id = 3,
title = "Dispatch Call",
description = {
{ label = "10-01", type = "" },
{ label = "10-01", type = "success" },
{ label = "10-01", type = "warning" },
{ label = "10-01", type = "error" },
{ label = "10-01", type = "info" },
},
content = {
{ icon = 'car', text = 'Vehicle Call' },
{ icon = 'car-burst', text = 'Vehicle Crash' },
{ icon = 'map-location-dot', text = 'Location' },
},
meta = "Example Default Meta",
} --[[@as Notification]]
SendNotification(data)
end
Last updated