Snippes
If you want to integrate the notification system into your es_extended framework, you can replace the default ESX.ShowNotification function. Add the following code to your client/functions.lua:
function ESX.ShowNotification(message, type, length)
if GetResourceState('JJ-Notify') ~= 'missing' then
if type == 'error' then
exports['JJ-Notify']:Alert("Error", message, 5000, 'error', true)
elseif type == 'info' then
exports['JJ-Notify']:Alert("Info", message, 5000, 'info', true)
elseif type == 'success' then
exports['JJ-Notify']:Alert("Success", message, 5000, 'success', true)
elseif type == 'warning' then
exports['JJ-Notify']:Alert("Warning", message, 5000, 'warning', true)
else
exports['JJ-Notify']:Alert("Info", message, 5000, 'info', true)
end
else
print('[JJ-Notify]: ERROR: JJ-Notify resource not FOUND or not STARTED!')
end
end
This code will allow the system to use the JJ-Notify
notifications in place of the default ESX notifications. Simply replace the existing notification handling with this snippet in your server's client/functions.lua
.