- Download the file and put it in the resource directory
- Install Sql
CREATE TABLE IF NOT EXISTS `sy_notify` ( `identifier` varchar(65) DEFAULT NULL, `position` longtext DEFAULT NULL, UNIQUE KEY `identifier` (`identifier`) USING HASH ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- Rename the Folder to SY_Notify.
- Add
ensure SY_Notify
in you're server.cfg
-
To display a notification you should call it like below:
- Using Client Side:
exports['SY_Notify']:Alert("Title", "Message", Time, 'type')
- Using Server Side:
TriggerClientEvent('SY_Notify:Alert', source, "Title", "Message", Time, 'type')
-
To set the notification display time, use:
- 1000 -
[1 second]
- 2000 -
[2 seconds]
- 5000 -
[5 seconds]
- 10000 -
[10 seconds]
- etc...
- 1000 -
-
To change the type of notification, use this types of notifications:
- success
- info
- warning
- error
- announcement
-
IF YOU NEED TO ADD THIS NOTIFICATION AS DEFAULT IN ESX LEGACY ADD THE GIVEN CODE IN @es_extended/client/function.lua
function ESX.ShowNotification(message, type, length)
if GetResourceState("esx_notify") ~= "missing" then
exports["esx_notify"]:Notify(type, length, message)
else
print("[^1ERROR^7] ^5ESX Notify^7 is Missing!")
end
end
replace it with
function ESX.ShowNotification(message, type, length)
if GetResourceState("SY_Notify") ~= "missing" then
exports['SY_Notify']:Alert("NOTIFICATION", message, length, type)
else
print("[^1ERROR^7] ^5SY_NOTIFY^7 is Missing!")
end
end