This is a free and open Fivem script that lets you create multiple styles of reusable notifications. It’s an easy to use and configure resource, that helps you customize your server.
Find where you register the /job command, and place the export or the TriggerEvent() in that function. You also have to get the player’s job and add that in the text string aswell.
You have to find and replace every ESX notification function in every script manually, there’s no other way to do that. If you use VSCode, there’s an option where you can search in every file.
If you read the GitHub documentation, it says that you have to define notification types in the notification.js file. This is where you choose the color aswell. If you have that, then you call the "k5_notify:notify" client event on the server and pass the defined type’s name as the 5th parameter of TriggerClientEvent.
server.lua: TriggerClientEvent("k5_notify:notify", source, "TITLE", "This is a test", "yourDefinedTypeName", 5000)
You can do that, but that would introduce some problems. For example, ESX.ShowNotification() can interpret control names, like ~INPUT_CONTEXT~ to show a key, or ~r~ to make the text red. These will not be converted in my notification, so the messages would look like this: Press ~INPUT_CONTEXT~ to ~r~remove~s~ objects.
So you would still have to check your ESX.ShowNotification messages to remove these parts.
This resource was not made to replace ESX.ShowNotification. This is a general tool that you can customize and use as you wish. If you want to replace your current ESX notifications with this resource, feel free to do that, but that’s a framework specific feature and this script is standalone. What you’re asking is possible with this script, but you have to do that yourself, since it is your server’s specific feature.
Hello, I just downloaded the resource on github and the notification is left instead of right! How can I put it on the right please I tried to modify the css but nothing changes!
Thank you for your valuable help!
If you set the fromRightToLeft to false, the notification comes from the left. The problem here is that you could set the left value to something like 900, and the notification would appear somewhere on the left, but if a player has a resolution like 1024x768, they wouldn’t be able to see the box, because it would be outside their screen. If you don’t mind that, you could set it to 900, but the you would have to delete your local storage in the NUI DevTools to see this in action. To be able to do this feature I should add a new config to set the default values and determinate the width of the screen for each player. I might add this in the future.