Deltarix Scripts
TebexDiscord
  • Information
    • About Me - Deltarix
  • Keymaster
    • FiveM Asset Escrow
    • Authentication
    • Transfers
  • Paid Assets
    • MDT V2
      • Setup
      • Locales
      • Configurations
        • Server
        • Client
        • Settings
        • 10 Codes
        • Commands
      • Exports
        • Server
          • OpenMDT
          • OpenVehicleDetailsInMDT
          • GetStateId
          • GetOfficer
          • GetPlayerWanted
          • GetPlateFlagged
          • GetOfficerSuspended
          • GetWeaponRegistered
          • GetOfficerClockedIn
          • GetClosestCamera
          • CreateWeapon
          • CreateOfficer
          • DeleteOfficer
          • UpdateCitizenData
          • UpdateCitizenPoints
          • ToggleCamera
          • ToggleCameraTimeout
          • ToggleClock
        • Client
          • OpenMDT
          • InsertPhotoToGallery
      • Bridges
        • Server
          • Framework
            • es_extended
            • qb-core
            • qbx_core
          • Garage
            • esx_garage
            • qb-garages
            • qbx_garages
          • Inventory
            • ox_inventory
            • qb-inventory
          • Licence
            • es_extended
            • qb-core
            • qbx_core
          • Property
            • esx_property
            • qb-apartments
            • qbx_apartments
          • Utilities
            • Logger
        • Client
          • Garage
            • esx_garage
            • qb-garages
            • qbx_garages
          • Utilities
            • Camera
      • Dependencies
      • Known Bugs
      • Common Issues and Troubleshooting
    • Dispatch
      • Exports
        • Server
          • Notifications
          • IsDispatcher
          • GetDispatchersByGroup
          • GetGroups
          • GetStateId
        • Client
          • defaultNotification
          • officerNotification
          • dispatchNotification
          • Copy of dispatchNotification
      • Dependencies
Powered by GitBook
On this page

Was this helpful?

  1. Paid Assets
  2. Dispatch
  3. Exports
  4. Server

Notifications


Default Notification

TriggerClientEvent('drx_dispatch:client:defaultNotification', source, ...)
---@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.defaultNotification(...)
  local data = {
    id = 1,
    title = "Example Default Title",
    description = "Example Default Description",
    content = "Example Default Content",
    meta = "Example Default Meta"
  } --[[@as Notification]]
  SendNotification(data)
end

Officer Notification

TriggerClientEvent('drx_dispatch:client:officerNotification', source, ...)
---@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

Dispatch Notification

TriggerClientEvent('drx_dispatch:client:dispatchNotification', source, ...)
---@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

Panic Notification

TriggerClientEvent('drx_dispatch:client:panicNotification', source, ...)
---@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.panicNotification()
  local data = {
    id = 4,
    title = "PANIC BUTTON PRESSED",
    description = "John Doe",
    content = "Officer has pressed the panic button at x, x, x, x",
    meta = "Example Default Meta",
    closable = false,
    duration = 10000
  } --[[@as Notification]]
  SendNotification(data)
end

Last updated 1 year ago

Was this helpful?