If you want to use this script and have it notify you with origen_notify, you can do the following:
ORIGINAL SETUP:
Notification = function(title, message, msgType, length)
-- Your notification here
end
ADJUSTMENT FOR THE origen_notify SCRIPT:
-- Notification system will be initialized after QBCore is ready
Notification = function(title, message, msgType, length)
if not message then return end
-- If it's a help notification (starts with [key])
if string.find(message, "^%[.%].+") then
if not Config.noty_buffer then
Config.noty_buffer = {}
-- Initialize the cleanup thread if not already done
Citizen.CreateThread(function()
while true do
Citizen.Wait(200)
if Config.noty_buffer then
for k, v in pairs(Config.noty_buffer) do
if GetGameTimer() - v.time > 200 then
exports["origen_notify"]:RemoveHelp(v.noty)
Config.noty_buffer[k] = nil
end
end
end
end
end)
end
-- Help notification
if Config.noty_buffer[message] then
Config.noty_buffer[message].time = GetGameTimer()
else
local textformated = message or ""
local key = ""
if string.find(textformated, "~y~") then
textformated = string.gsub(textformated, "~y~", "")
key = string.sub(textformated, 1, 1)
textformated = string.sub(textformated, 2)
textformated = string.gsub(textformated, "~w~", "")
end
Config.noty_buffer[message] = {
time = GetGameTimer(),
noty = exports["origen_notify"]:CreateHelp(key, textformated)
}
end
return
end
-- Regular notifications
local notifyType = 'info'
if msgType == 'error' then
notifyType = 'error'
elseif msgType == 'success' then
notifyType = 'success'
end
exports['origen_notify']:ShowNotification(message, notifyType, length or 5000)
end
With this adjustment, you’ll be able to see notifications using origen_notify.