Exports and Events
Here is the event and export to use in your scripts to display notifications.
Via export (Client-Side)
exports['PNotifv2']:sendNotification({
message = 'Your message here',
type = 'info',
title = 'Custom Header',
duration = 5000
})Via Event (Serveur to Client)
TriggerClientEvent('pnotifv2:sendNotification', source, {
message = 'Your message here',
type = 'info',
title = 'Custom Header',
duration = 5000
})Example
RegisterCommand('notifyServerTest', function(source, args, rawCommand)
TriggerClientEvent('pnotifv2:sendNotification', source, {
title = '~r~Colored~s~ ~g~Title~s~',
message = 'This is a test with a ~b~colored title~s~ sent from the server',
type = 'success',
duration = 5000
})
TriggerClientEvent('pnotifv2:sendNotification', source, {
title = '~y~Warning~s~',
message = '~o~Important~s~ message with a ~bold~bold title~s~',
type = 'error',
duration = 5000
})
TriggerClientEvent('pnotifv2:sendNotification', source, {
title = '~lg~Great~s~ ~bold~Success~s~',
message = 'Operation completed successfully with a ~g~colored title~s~',
type = 'info',
duration = 5000
})
end)You can always use esx.ShowNotification.
If you make any changes in your es_extended, go to the file es_extended/client/functions.lua.
Replace
Then, add this
To use the ESX notification trigger, use this one:
Client
Server
QBCore
You can always use QBCore.Functions.Notify.
If you make any changes in your qb-core, go to the file qb-core/client/functions.lua.
Replace
Then, add this
Client
Server
Last updated