40 lines
1.2 KiB
Lua
40 lines
1.2 KiB
Lua
local Debug = ESX.GetConfig().EnableDebug
|
|
|
|
local function Notify(notificatonType, length, message)
|
|
if type(notificatonType) ~= "string" then
|
|
notificatonType = "info"
|
|
end
|
|
if type(length) ~= "number" then
|
|
length = 3000
|
|
end
|
|
exports['hex_4_hud']:Notify(nil, message, notificatonType, length)
|
|
end
|
|
|
|
-- Dummy damit es_extended keinen Fehler wirft
|
|
local function NuiMessage(data)
|
|
if data and data.message then
|
|
exports['hex_4_hud']:Notify(nil, data.message, data.type or "info", data.length or 3000)
|
|
end
|
|
end
|
|
|
|
exports('Notify', Notify)
|
|
exports('NuiMessage', NuiMessage)
|
|
RegisterNetEvent("ESX:Notify", Notify)
|
|
|
|
if Debug then
|
|
RegisterCommand("notify", function()
|
|
ESX.ShowNotification("You Recived ~br~ 1x ball~s~!", "success", 3000)
|
|
end, false)
|
|
|
|
RegisterCommand("notify1", function()
|
|
ESX.ShowNotification("Well ~g~Done~s~!", "success", 3000)
|
|
end, false)
|
|
|
|
RegisterCommand("notify2", function()
|
|
ESX.ShowNotification("Information Recived", "info", 3000)
|
|
end, false)
|
|
|
|
RegisterCommand("notify3", function()
|
|
ESX.ShowNotification("You Did something ~r~WRONG~s~!", "error", 3000)
|
|
end, false)
|
|
end |