FiveM notification script for roleplay servers
Skeexs Inc. Discord Server
- Download the resource and start it in your server.cfg
- If youre using ESX Legacy, Goto `es_extended/client/functions.lua` and replace `ESX.ShowNotification` with the following code:
ESX.ShowNotification = function(message, type, options) if GetResourceState("skeexsNotify") ~= "started" then print("skeexsNotify is not started") return end exports.skeexsNotify:sendNotification({ type = type or "info", message = message or "No message", title = options.type or "Notification", timeout = options.timeout or 5000 }) end
ensure skeexsNotify
- success
- info
- error
- message
- phone
- bag
Go to `app.js` and add a new type like this in the `$TYPES` Object:
["iconname"]: {
["icon"]: "bi bi-telephone-inbound",
prefix: "~g~", // GTA color codes, doesn't need to be set. Just adds color to the message
},
There are 2 events you can use to send notifications to the client
TriggerClientEvent("skeexsNotify:sendNotification", source, {
type = "info",
message = "This is a notification",
title = "Notification",
timeout = 5000
})
exports.skeexsNotify:sendNotification({
type = "info",
message = "This is a notification",
title = "Notification",
timeout = 5000
})