49 lines
1.4 KiB
Lua
49 lines
1.4 KiB
Lua
RegisterNetEvent("Client:fireNotify")
|
|
AddEventHandler("Client:fireNotify", function(message)
|
|
showNotification(message)
|
|
end)
|
|
|
|
function showNotification(text)
|
|
|
|
if not main.notifications.Enabled then
|
|
return
|
|
end
|
|
|
|
if main.notifications.Framework.ESX then
|
|
if ESX ~= nil then
|
|
ESX.ShowNotification(text)
|
|
end
|
|
elseif main.notifications.Framework.QBCore then
|
|
TriggerEvent('QBCore:Notify', text, 'primary')
|
|
elseif main.notifications.Framework.QBX then
|
|
exports.qbx_core:Notify(text, 'inform')
|
|
elseif main.notifications.Framework.vRP then
|
|
vRP.notify(source, {text})
|
|
elseif main.notifications.Framework.okok then
|
|
exports['okokNotify']:Alert("Smart Fires", text, 2000, 'info', true)
|
|
else
|
|
showBaseNotification(text)
|
|
end
|
|
end
|
|
|
|
function showBaseNotification(message)
|
|
-- Base game notifications
|
|
SetNotificationTextEntry("STRING")
|
|
AddTextComponentString(message)
|
|
DrawNotification(0,1)
|
|
end
|
|
|
|
RegisterNetEvent("Client:fireNotificationCodeM")
|
|
AddEventHandler("Client:fireNotificationCodeM", function(coords, message)
|
|
local data = {
|
|
coords = coords,
|
|
type = main.fireAlerts.codeMDispatch.dispatchType,
|
|
header = message,
|
|
text = messge,
|
|
code = main.fireAlerts.codeMDispatch.dispatchCode,
|
|
job = main.fireAlerts.codeMDispatch.dispatchJobs,
|
|
}
|
|
|
|
exports['codem-dispatch']:CustomDispatch(data)
|
|
end)
|