vms* store - Docs
Purchase Asset
  • Welcome
  • Official Store
  • Discord
  • Helpful
    • Basic Server Knowledge
      • How to import SQL to database?
      • How to update server artifacts?
    • General Issues
    • Prepared Resources
  • ASSETS
    • vms_notifyV2
      • Installation
      • FAQ
      • Guides
        • Text Formatting
        • Swap in framework
      • Developer API
        • Client Exports
        • Server Events
      • Configuration Files
        • config.lua
        • config.js
    • vms_bossmenu
      • Installation
      • Compatibility
      • FAQ
      • Guides
        • Creating job2 on ESX
        • Paychecks Integration
      • Developer API
        • Client Exports
        • Client Events
        • Server Exports
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
    • vms_cityhall
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Guides
        • License Revocation
        • Personal Taxes Integration
        • Business Taxes Integration
        • Paychecks Integration
        • Add SSN Generation
        • Generate SSN for Players
        • Add VIN Generation
        • Generate VIN for Vehicles
      • Developer API
        • Client Exports
        • Server Exports
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.shared.lua
        • config.clerks.lua
        • config.taxes.lua
        • config.js
    • vms_documentsV2
      • Installation
      • FAQ
      • Common Errors
      • Guides
        • Add SSN Generation
        • Generate SSN for Players
        • Creating New Document
        • Driving School Integration
      • Developer API
        • Client Exports
        • Server Exports
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • metadata.js
    • vms_garagesV2
      • Installation
      • Compatibility
        • Housings
          • qs-housing
          • esx_property
          • bcs_housing
        • Phones
          • yflip-phone
          • qs-smartphone-pro
        • Other
          • VehicleDeformation
          • kq_wheeldamage
      • FAQ
      • Common Errors
      • Guides
        • Interior Stuck Prevention
        • Registering House Garage
      • Developer API
        • Client Exports
        • Server Exports
        • Server Events
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.garages.lua
        • config.management.lua
        • config.parkingcreator.lua
        • config.js
    • vms_houserobberies
      • Installation
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.items.lua
        • config.interiors.lua
        • config.houseslist.lua
        • config.configurator.lua
    • vms_vehicleshopV2
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Guides
        • Adjusting Required Licenses
        • Adjusting orderprice
        • Photos Tool
      • Developer API
        • Client Exports
        • Client Events
        • Server Exports
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
        • config.showroom.lua
        • config.js
    • vms_stores
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.camera.lua
        • config.robbery.lua
        • config.storemanage.lua
        • config.js
    • vms_reports
      • Installation
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.js
    • vms_tuning
      • Installation
      • FAQ
      • Common Errors
      • Guides
        • Garage Integration
          • jg-advancedgarages
        • Understanding Prices
        • Using whitelist & blacklist
        • Fix tuning parts names from NULL
        • Paychecks from the built-in balance
      • Developer API
        • Client Exports
        • Server Exports
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.vehicles.lua
        • config.tuningmenu.lua
        • config.installationparts.lua
        • config.custommods.lua
        • config.missions.lua
    • vms_gym
      • Installation
      • FAQ
      • Common Errors
      • Developer API
        • Client Exports
        • Server Exports
        • Server Events
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
    • vms_hud
      • Installation
      • FAQ
      • Common Errors
      • Developer API
        • Client Exports
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.js
    • vms_spawnselector
      • Installation
      • Compatibility
        • vms_multichars
        • esx_multicharacter
        • esx_identity
        • qb-multicharacter
      • FAQ
      • Developer API
        • Client Exports
        • Server Events
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
    • vms_guidebook
      • Installation
      • Guides
        • Text Formating
      • Developer API
        • Client Exports
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
        • pages.js
    • vms_coinshop
      • Installation
      • Configuration Files
        • config.lua
    • vms_vehicleshop
      • Installation
      • Configuration Files
        • config.lua
    • vms_gangmissions
      • Installation
      • Guides
        • Connection to NPCTALK
      • Configuration Files
        • config.lua
    • vms_charcreator
      • Installation
      • Compatibility
        • vms_multichars
        • esx_multicharacter
        • esx_identity
        • qb-multicharacter
        • ZSX_Multicharacter
        • renzu_multicharacter
      • FAQ
      • Developer API
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
    • vms_clothestore
      • Installation
      • Compatibilty
      • Common Errors
      • Developer API
        • Client Exports
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
        • config.prices.lua
        • config.js
    • vms_multichars
      • Installation
      • Compatibilty
      • Common Errors
      • Developer API
        • Commands
      • Configuration Files
        • config.lua
        • config_client.lua
        • config_server.lua
        • config_commands.lua
    • vms_identity
      • Installation
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
    • vms_barber
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
    • vms_tattooshop
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Guides
        • New ADD-ON Tattoos
      • Developer API
        • Client Exports
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
        • config.tattoos.lua
    • vms_driveschoolV2
      • Installation
      • Compatibility
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
    • vms_boatschoolV2
      • Installation
      • Compatibility
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.routes.lua
    • vms_flightschoolV2
      • Installation
      • Compatibility
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.routes.lua
    • vms_documents
      • Installation
      • Guides
        • Adding to radialmenu
        • Usage of documents
        • Adding new documents
      • Configuration Files
        • config.lua
    • vms_anims
      • Installation
      • Guides
        • Adding animations
        • Adding more binds
      • Developer API
        • Client Exports
      • Configuration Files
        • config.lua
        • animations.lua
        • keybinds.lua
    • vms_weaponshop
      • Installation
      • Configuration Files
        • config.lua
    • vms_notify
      • Installation
      • Guides
        • Implementation
        • Replace core notifications
Powered by GitBook
On this page

Was this helpful?

  1. ASSETS
  2. vms_notifyV2
  3. Guides

Swap in framework


Here are the modified functions to your framework to make notifications and textui automatically adjust as vms_notifyV2.

ESX

Notification

  1. Navigate to es_extended/client/functions.lua

  2. Find function ESX.ShowNotification

  3. Replace the function with the one below

function ESX.ShowNotification(message, notifyType, length)
    local type = "info" -- Default preset if there is no notifyType
    
    if notifyType == "success" then
        type = "success" -- Default preset for "success" type notification
    elseif notifyType == "error" then
        type = "error" -- Default preset for "error" type notification
    end
    
    if length ~= nil and not tonumber(length) then
        length = 5000 -- If the time is not given correctly or if it is not as a number
    end    

    return exports['vms_notifyv2']:Notification({
        description = message,
        time = length,
        preset = type
    })
end
  1. Find function ESX.ShowAdvancedNotification

  2. Replace the function with the one below

function ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)
    if subject and subject ~= "" then
        exports['vms_notifyv2']:Notification({
            title = sender,
            description = subject .. '~n~' .. msg,
            time = 6500,
            preset = 'info'
        })
    else
        exports['vms_notifyv2']:Notification({
            title = sender,
            description = msg,
            time = 6500,
            preset = 'info'
        })
    end
end

TextUI

  1. Navigate to es_extended/client/functions.lua

  2. Find function ESX.TextUI and ESX.HideUI

  3. Replace the function with the one below

function ESX.TextUI(message)
    exports['vms_notifyv2']:ShowTextUI(message)
end

function ESX.HideUI()
    exports['vms_notifyv2']:HideTextUI(message)
end
QB-Core

Notification

  1. Navigate to qb-core/client/functions.lua

  2. Find function QBCore.Functions.Notify

  3. Replace the function with the one below

function QBCore.Functions.Notify(text, texttype, length, icon)
    local message = {
        action = 'notify',
        type = texttype or 'info',
        length = length or 5000,
    }

    if type(text) == 'table' then
        message.text = text.text
        message.caption = text.caption
    else
        message.text = text
    end

    local description = ""
    if message.caption then
        description = message.text .. '~s~' .. message.caption
    else
        description = message.text
    end

    if message.type == "primary" then
        message.type = "info"
    end

    if icon then
        message.icon = icon
    end

    exports['vms_notifyv2']:Notification({
        description = description,
        time = length,
        icon = message.icon,
        preset = message.type
    })
end

TextUI

  1. Navigate to qb-core/client/drawtext.lua

  2. Replace the entire file with the following code

local function hideText()
    exports['vms_notifyv2']:HideTextUI()
end

local function drawText(text, position)
    exports['vms_notifyv2']:ShowTextUI(text)
end

local function changeText(text, position)
    exports['vms_notifyv2']:UpdateTextUI(text)
end

local function keyPressed()
    exports['vms_notifyv2']:HideTextUI()
end

RegisterNetEvent('qb-core:client:DrawText', function(text, position)
    drawText(text)
end)

RegisterNetEvent('qb-core:client:ChangeText', function(text, position)
    changeText(text)
end)

RegisterNetEvent('qb-core:client:HideText', function()
    hideText()
end)

RegisterNetEvent('qb-core:client:KeyPressed', function()
    keyPressed()
end)

exports('DrawText', drawText)
exports('ChangeText', changeText)
exports('HideText', hideText)
exports('KeyPressed', keyPressed)
QBOX-Core

Notification

  1. Navigate to qbx_core/client/functions.lua

  2. Find function Notify

  3. Replace the function with the one below

function Notify(text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor)
    local title, description
    
    if type(text) == 'table' then
        title = text.text
        description = text.caption or nil
    elseif subTitle then
        title = text
        description = subTitle
    else
        description = text
    end
    
    if not notifyType or notifyType and notifyType == "primary" then
        notifyType = "info"
    end
        
    exports['vms_notifyv2']:Notification({
        title = title,
        description = description,
        time = duration,
        icon = notifyIcon,
        preset = notifyType
    })
end

TextUI

  1. Navigate to qbx_core/bridge/qb/client/drawtext.lua

  2. Replace the entire file with the following code

local function hideText()
    exports['vms_notifyv2']:HideTextUI()
end

local function drawText(text, position)
    exports['vms_notifyv2']:ShowTextUI(text)
end

local function changeText(text, position)
    exports['vms_notifyv2']:UpdateTextUI(text)
end

local function keyPressed()
    exports['vms_notifyv2']:HideTextUI()
end

RegisterNetEvent('qb-core:client:DrawText', function(text, position)
    drawText(text)
end)

RegisterNetEvent('qb-core:client:ChangeText', function(text, position)
    changeText(text)
end)

RegisterNetEvent('qb-core:client:HideText', function()
    hideText()
end)

RegisterNetEvent('qb-core:client:KeyPressed', function()
    keyPressed()
end)

local createQbExport = require 'bridge.qb.shared.export-function'

createQbExport('DrawText', drawText)
createQbExport('ChangeText', changeText)
createQbExport('HideText', hideText)
createQbExport('KeyPressed', keyPressed)
ox_lib

Notification

  1. Navigate to ox_lib/resource/interface/client/notify.lua

  2. Find function lib.notify

  3. Replace the function with the one below

function lib.notify(data)
    if data.type and data.type == "inform" then
        data.type = "info"
    end
    
    exports['vms_notifyv2']:Notification({
        title = data.title,
        description = data.description,
        time = data.duration,
        color = data.iconColor,
        icon = data.icon,
        preset = data.type,
    })
end

TextUI

  1. Navigate to ox_lib/resource/interface/client/textui.lua

  2. Find function lib.showTextUI

  3. Replace the function with the one below

function lib.showTextUI(text, options)
    if currentText == text then return end

    if not options then options = {} end

    options.text = text
    currentText = text

    exports['vms_notifyv2']:ShowTextUI(currentText)

    isOpen = true
end
  1. Find function lib.hideTextUI

  2. Replace the function with the one below

function lib.hideTextUI()
    exports['vms_notifyv2']:HideTextUI()

    isOpen = false
    currentText = nil
end
TX Admin

Announcement

  1. Navigate to txAdmin/resource/sv_main.lua

  2. Find function TX_EVENT_HANDLERS.announcement

  3. Replace the function with the one below

TX_EVENT_HANDLERS.announcement = function(eventData)
    local authorName = cvHideAdminInMessages and txServerName or eventData.author or 'anonym'
    if not cvHideAnnouncement then
        TriggerClientEvent("vms_notifyv2:TopNotification", -1, {
            title = "ANNOUNCEMENT",
            description = eventData.message,
            time = 15000,
            color = "#ffc31f",
            icon = "fa-solid fa-bullhorn",
        })
    end
    TriggerEvent('txsv:logger:addChatMessage', 'tx', '(Broadcast) '..authorName, eventData.message)
end

Restart

  1. Navigate to txAdmin/resource/sv_main.lua

  2. Find function TX_EVENT_HANDLERS.scheduledRestart

  3. Replace the function with the one below

TX_EVENT_HANDLERS.scheduledRestart = function(eventData)
    if not cvHideScheduledRestartWarning then
        TriggerClientEvent("vms_notifyv2:TopNotification", -1, {
            title = "RESTART",
            description = eventData.translatedMessage,
            time = 15000,
            color = "#ff1f39",
            icon = "fa-solid fa-power-off",
        })
    end
    TriggerEvent('txsv:logger:addChatMessage', 'tx', '(Broadcast) txAdmin', eventData.translatedMessage)
end

Last updated 2 months ago

Was this helpful?