mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
refactor: ESX Notify - Better Blue, Better Readme,
This commit is contained in:
@@ -7,8 +7,8 @@ local function Notify(notificatonType, length, message)
|
||||
|
||||
if Debug then
|
||||
print("1 ".. tostring(notificatonType))
|
||||
print("1 "..tostring(length))
|
||||
print("1 "..message)
|
||||
print("2 "..tostring(length))
|
||||
print("3 "..message)
|
||||
end
|
||||
|
||||
if type(notificatonType) ~= "string" then
|
||||
@@ -20,9 +20,9 @@ local function Notify(notificatonType, length, message)
|
||||
end
|
||||
|
||||
if Debug then
|
||||
print("2 ".. tostring(notificatonType))
|
||||
print("2 "..tostring(length))
|
||||
print("2 "..message)
|
||||
print("4 ".. tostring(notificatonType))
|
||||
print("5 "..tostring(length))
|
||||
print("6 "..message)
|
||||
end
|
||||
|
||||
SendNuiMessage(json.encode({
|
||||
@@ -37,10 +37,14 @@ exports('Notify', Notify)
|
||||
RegisterNetEvent("ESX:Notify", Notify)
|
||||
|
||||
if Debug then
|
||||
RegisterCommand("notify", function()
|
||||
RegisterCommand("oldnotify", function()
|
||||
ESX.ShowNotification('No Waypoint Set.', true, false, 140)
|
||||
end)
|
||||
|
||||
RegisterCommand("notify", function()
|
||||
ESX.ShowNotification("You Recived ~br~ 1x ball~s~!", "success", 3000)
|
||||
end)
|
||||
|
||||
RegisterCommand("notify1", function()
|
||||
ESX.ShowNotification("Well ~g~Done~s~!", "success", 3000)
|
||||
end)
|
||||
|
||||
@@ -3,7 +3,7 @@ lua54 'yes'
|
||||
game 'gta5'
|
||||
|
||||
author 'ESX-Framework'
|
||||
description 'ESX Notification system for esx_legacy'
|
||||
description 'Official NUI Notification system for ESX'
|
||||
|
||||
shared_script '@es_extended/imports.lua'
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const types = {
|
||||
// the color codes example `i ~r~love~s~ donuts`
|
||||
const codes = {
|
||||
"~r~": "red",
|
||||
"~b~": "blue",
|
||||
"~b~": "#378cbf",
|
||||
"~g~": "green",
|
||||
"~y~": "yellow",
|
||||
"~p~": "purple",
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<h1 align="center">ESX Notify</h1>
|
||||
<h1 align='center'>[ESX] Notify</a></h1><p align='center'><b><a href='https://discord.esx-framework.org/'>Discord</a> - <a href='https://esx-framework.org/'>Website</a> - <a href='https://docs.esx-framework.org/legacy/installation'>Documentation</a></b></h5>
|
||||
|
||||
A beautiful and simple NUI notification system for ESX
|
||||
|
||||
# Example Code
|
||||
|
||||
<h3>Change style and time</h3>
|
||||
|
||||
@@ -39,4 +43,10 @@ TriggerEvent("ESX:Notify", "info", 3000, "message here")
|
||||
ESX.ShowNotification("I i ~r~love~s~ donuts", "success", 3000)
|
||||
```
|
||||
|
||||
<img src="https://imgur.com/gsNwFO3.png" alt="image">
|
||||
# Previews
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user