Bridges
Bridges make the scripts already on your server show the gui_interface notification and progress, without changing every call.
| Bridge | Answers for |
|---|---|
Config.pontes.vrp | events Notify, itensNotify, progress and the vrp_taskbar taskbar |
Config.pontes.esx | esx_notify and esx_progressbar |
Config.pontes.qbcore | the progressbar resource |
Config.pontes.mythic | mythic_notify |
Config.pontes.okok | okokNotify |
vRP
Nothing to do. With Config.pontes.vrp = true (default) these already work:
TriggerClientEvent("Notify", source, "sucesso", "Text", 5000)
TriggerClientEvent("itensNotify", source, "Recebeu", "water", 2)
TriggerClientEvent("progress", source, 10000, "Text")So does the old vrp_taskbar (vTASKBAR.taskThree(source) and the others).
ESX
Notification and progress
Pick one option.
Option A, without touching ESX:
- In
server.cfg, removeensure esx_notifyandensure esx_progressbar. Leave the folders where they are. - In gui_interface’s
fxmanifest.lua, remove the--from these lines:gui_interface/fxmanifest.luaprovide "esx_notify" provide "esx_progressbar" - In
config.lua:Config.pontes.esx = true. - Put
ensure gui_interfacebeforeensure es_extended.
If F8 shows Resource esx_notify is Missing, use option B.
Option B, one line in ESX. File es_extended/client/modules/ui/notifications.lua (older ESX: es_extended/client/functions.lua). Keep Config.pontes.esx = false.
First line inside function ESX.ShowNotification(...):
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:EsxNotify(notifyType, length, message, title) endFirst line inside function ESX.Progressbar(...):
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:EsxProgress(message, length, options) endFirst line inside function ESX.CancelProgressbar():
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:PararProgresso() endThis covers ESX.ShowNotification, xPlayer.showNotification, esx:showNotification and ESX.Progressbar.
Items
Automatic with the default ESX inventory and with ox_inventory (Config.itens.automatico = true).
QBCore
Notification
File qb-core/client/functions.lua, first line inside function QBCore.Functions.Notify(text, texttype, length, icon):
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:QBNotify(text, texttype, length) endCovers QBCore.Functions.Notify and TriggerClientEvent("QBCore:Notify", ...).
Progress
Pick one option.
Option A, one line in the progressbar resource. File progressbar/client.lua, first line inside local function StartProgress(action, onStart, onTick, onFinish):
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:QBProgress(action, onFinish, onStart, onTick) endCovers QBCore.Functions.Progressbar, every progressbar export and the progressbar:client:cancel event.
Option B, without editing:
- In
server.cfg, removeensure progressbar. - In gui_interface’s
fxmanifest.lua, remove the--fromprovide "progressbar". Config.pontes.qbcore = true.
If you see progressbar needs to be started, use option A.
Items
Automatic with qb-inventory, ps-inventory, lj-inventory and ox_inventory.
qb-inventory keeps showing its own box when a script fires qb-inventory:client:ItemBox. To show only ours, empty that event’s body in qb-inventory/client/main.lua.
QBox and ox_lib
QBox uses ox_lib for notifications and progress. Only edit ox_lib.
File ox_lib/resource/interface/client/notify.lua, first line inside function lib.notify(data):
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:OxNotify(data) endFile ox_lib/resource/interface/client/progress.lua, first line inside function lib.progressBar(data) and function lib.progressCircle(data):
if GetResourceState("gui_interface") == "started" then return exports.gui_interface:OxProgress(data) endSame file, first line of function lib.progressActive():
if GetResourceState("gui_interface") == "started" and exports.gui_interface:ProgressoAtivo() then return true endAnd first line of function lib.cancelProgress():
if GetResourceState("gui_interface") == "started" and exports.gui_interface:ProgressoAtivo() then return exports.gui_interface:PararProgresso() endCovers lib.notify, exports.qbx_core:Notify, TriggerClientEvent("ox_lib:notify", ...), lib.progressBar and lib.progressCircle.
Items: automatic with ox_inventory.
mythic_notify and okokNotify
- In
server.cfg, removeensure mythic_notify(orensure okokNotify). - In
fxmanifest.lua, remove the--fromprovide "mythic_notify"(orprovide "okokNotify"). Config.pontes.mythic = true(orConfig.pontes.okok = true).
Scripts calling exports["mythic_notify"]:DoHudText(...), mythic_notify:client:SendAlert, exports["okokNotify"]:Alert(...) or okokNotify:Alert now show our notification.
Another script with its own notification
Replace its call:
-- before
exports["my_notify"]:Show("Text", "success")
-- after
exports.gui_interface:Notificar("success", "Text")Updating ESX, qb-core, progressbar or ox_lib removes the lines above. Add them again after each update.