LV Soft FiveM
  • LV SOFT
    • 👋Welcome!
    • 🛒Tebex
    • 💬Discord
  • QB/ESX
    • ☮️lvs-loading
      • Installation
      • Configuration
    • 👫lvs-multichar
      • Installation
      • Configuration
      • Adding Scenes
      • Tebex Integration
      • Commands
    • 🗺️lvs-spawnselector
      • Installation
      • Configuration
    • 🥼lvs-clothing
      • Installation
        • QBCore Install
        • ESX Install
      • Configuration
      • Migration
        • qb-clothing
        • esx-skinchanger
        • Illenium-Appareance
      • Blacklisting
      • Events
      • Commands
    • ⚙️lvs-lib
      • black-screen loading
      • notifications
      • progressbar
      • key-interaction
      • textui
      • alert
      • context menu
      • context input
    • 💬lvs-chat
      • Installation
      • Configuration
      • Events & Exports
    • 📱lvs-radio
      • Installation
      • Configuration
      • Events & Exports
    • 🗃️lvs-playerlist
      • Installation
      • Configuration
    • 📹lvs_weazelnews
      • Installation
      • Configuration
    • 🎒lvs-inventory
      • Installation
      • Configuration
      • lvs-inventory
        • exports
      • lvs-shops
        • Configuration
        • Exports
      • lvs-crafting
    • 🪪lvs-idmanager
      • Installation
      • Configuration
      • Exports
  • Standalone
    • 🚘lvs-drift
      • Installation
      • Configuration
      • Commands
    • 🕺lvs-animations
      • Installation
      • Configuration
      • Adding Animations
      • Exports/Events
    • 💥lvs-accident
      • Installation
      • Configuration
    • 🔥lvs-explosion
      • Installation
      • Configuration
    • 🏎️lvs-racing
  • ESX
    • 📅Soon
Powered by GitBook
On this page
  • Notifications
  • How to use:
  • QBCore Integration:
  1. QB/ESX
  2. lvs-lib

notifications

Previousblack-screen loadingNextprogressbar

Last updated 10 months ago

Notifications


How to use:

Event:

message = 'Message content'
type = 'info'                -- info | warning | error
options = {
    time = 6000,             -- duration time
    position = 'top-left'    -- top-left | top-right | bottom-left | bottom-right
    caption = 'Optional Title'
}

-- from client
TriggerEvent('lvs_lib:client:notify', message, type, options)

-- from server
TriggerClientEvent('lvs_lib:client:notify', source, message, type, options)

Export:

message = 'Message content'
type = 'info'                -- info | warning | error
options = {
    time = 6000,             -- duration time
    position = 'top-left'    -- top-left | top-right | bottom-left | bottom-right
    caption = 'Optional Title'
}

exports.lvs_lib:notify(message, type, options)

QBCore Integration:

Edit qb-core/client/functions.lua, replace the function QBCore.Functions.Notify(line 83) with:

function QBCore.Functions.Notify(text, texttype, length)
    local message
    local caption
    if type(text) == 'table' then
        message = text.text
        caption = text.caption
    else
        message = text
    end
    if texttype == 'police' or  texttype == 'ambulance' then
        texttype = 'warning'
    end
    TriggerEvent('lvs_lib:client:notify', message, texttype, {caption = caption, time = length})
end

⚙️