Notify
client/custom/notify
Config.Notify = 'default' -- default, customif Config.Notify ~= 'default' then
return
end
local vRP
if Config.Framework == 'vrp' then
vRP = Proxy.getInterface('vRP')
end
function Notify(message, type)
if Config.Framework == 'qb-core' then
TriggerEvent('QBCore:Notify', message, type)
elseif Config.Framework == 'qbox' then
exports['qbx_core']:Notify(message, type)
elseif Config.Framework == 'esx' then
TriggerEvent('esx:showNotification', message, type)
elseif Config.Framework == 'vrp' then
vRP.notify({ message, type })
end
endConfig.Notify = 'custom' -- default, customif Config.Notify ~= 'custom' then
return
end
---@param message string
---@param type string
function Notify(message, type)
-- implement your logic here (this is just an example)
TriggerEvent('chat:addMessage', {
args = { '[Gang-Activities]', message },
color = { 255, 255, 255 },
multiline = true
})
endserver/custom/notify
Config.Notify = 'default' -- default, customif Config.Notify ~= 'default' then
return
end
local vRPClient
if Config.Framework == 'vrp' then
local Tunnel = module('vrp', 'lib/Tunnel')
vRPClient = Tunnel.getInterface('vRP', 'gang-activities')
end
function Notify(source, message, type)
if Config.Framework == 'qb-core' then
TriggerClientEvent('QBCore:Notify', source, message, type)
elseif Config.Framework == 'qbox' then
exports['qbx_core']:Notify(source, message, type)
elseif Config.Framework == 'esx' then
TriggerClientEvent('esx:showNotification', source, message, type)
elseif Config.Framework == 'vrp' then
vRPClient.notify(source, { message, type })
end
end
Config.Notify = 'custom' -- default, customif Config.Notify ~= 'custom' then
return
end
---@param source number
---@param message string
---@param type string
function Notify(source, message, type)
-- implement your logic here (this is just an example)
TriggerClientEvent('chat:addMessage', source, {
args = { '[Gang-Activities]', message },
color = { 255, 255, 255 },
multiline = true
})
end
Last updated
Was this helpful?