officerNotification


exports.drx_dispatch:officerNotification(...)
TriggerEvent('drx_dispatch:client:officerNotification', ...)
---@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.officerNotification()
  local data = {
    id = 2,
    title = "John Doe",  -- Name
    description = {
      callsign = "B501", -- Callsign
      department = 0,    -- Department
      rank = 0           -- Rank
    },
    content = "Example Default Content",
    meta = "Example Default Meta",
    duration = 30000,
    image = "https://upload.wikimedia.org/wikipedia/en/thumb/6/6c/Neytiri_%28Avatar%29.webp/250px-Neytiri_%28Avatar%29.webp.png"
  } --[[@as Notification]]
  SendNotification(data)
end

Last updated