❤️Frameworks
ATENTION!
The script is designed as a standalone resource compatible with any FiveM framework (ESX, QBCore, vRP, etc.), we currently provide official pre-built integrations only for QBCore and ESX.
For other frameworks, you can still use mg-notify by:
Calling exports/events directly
Creating custom wrapper functions
Modifying existing notification handlers
Need help integrating with another framework? Feel free to open a ticket on our discord or check our community posts for user-contributed examples!
QB-Core
Locate the file:
qb-core/client/functions.lua
Replace the
QBCore.Functions.Notify
function with:
function QBCore.Functions.Notify(text, texttype, length)
local convert = {
["primary"] = 'info',
["police"] = 'lspd',
["ambulance"] = 'ems'
}
texttype = texttype or 'info'
texttype = convert[texttype] or texttype
if type(text) == "table" then
TriggerEvent('mg-notify:notify',
text.text or 'Placeholder',
texttype,
text.caption or 'Placeholder',
length or 5000
)
else
TriggerEvent('mg-notify:notify', text, texttype, nil, length or 5000)
end
end
Key Features
🔹 Backwards Compatibility - Existing scripts using QBCore.Functions.Notify
work unchanged
ESX
Locate the file:
qb-core/client/functions.lua
Replace the
QBCore.Functions.Notify
function with:
function ESX.ShowNotification(text, type, duration, title)
local themeMap = {
['primary'] = 'info',
['police'] = 'lspd',
['ambulance'] = 'ems'
}
type = type or 'info'
local notifyType = themeMap[type] or type
local notifyDuration = duration or 5000
TriggerEvent('mg-notify:notify', text, notifyType, title, notifyDuration)
end
end
Key Features
🔹Backwards Compatibility - Existing scripts using ESX.ShowNotification()
work unchanged
Last updated