Notifications
In the PLocker system, we have integrated the default notifications: ESX notifications for the ESX version, and QB-Core’s native notifications for the QB-Core version.
You can easily add your own notification system. To do this, go to editable/notif/custom.lua and set up your system using an event.
Here is the configuration of our notification system integrated into PLocker.
-----------------------------------------------
-- PNotif Notification System
-- Système de notifications PNotif
-----------------------------------------------
Notify = {}
function Notify.Send(playerId, message, title, type, duration)
if not playerId then
print('^1[PLocker] Notify.Send: playerId est nil !^0')
return
end
TriggerClientEvent('pnotif:sendNotification', playerId, {
title = title or 'Notification',
message = message or '',
type = type or 'info',
duration = duration or 4000
})
end
And here is the custom.lua file, where you can integrate your own system.
custom.lua file, where you can integrate your own system.-----------------------------------------------
-- NOTIFICATION SYSTEM
-- SYSTÈME DE NOTIFICATION
-- Easy integration with any inventory system (events/exports)
-- Intégration facile avec n'importe quel système d’inventaire (events/exports)
-----------------------------------------------
Notify = {}
--[[
FR :
Ce système de notification est entièrement personnalisable.
Les développeurs peuvent remplacer ou connecter leur propre
système de notifications directement au script PLocker en
modifiant cette fonction ou en utilisant leurs events/exports.
EN :
This notification system is fully customizable.
Developers can replace or connect their own notification
system directly to the PLocker script by editing this function
or using their own events/exports.
--]]
function Notify.Send(playerId, message, title, type, duration)
if not playerId then
print('^1[PLocker] Notify.Send: playerId is nil!^0')
return
end
TriggerClientEvent('locker:notify', playerId, {
title = title or 'Notification',
message = message or '',
type = type or 'info',
duration = duration or 4000
})
end
Last updated

