Installation
#Requirements
| Requirement | Status |
|---|---|
| QBCore, Qbox, ESX, ox_lib or standalone | Required |
#Installation
- Put
aw_notifyin your resources folder and add it right belowensure ox_lib:server.cfgensure aw_notify - Connect your framework (once). Open the file below for the framework you use and make the change shown. Only change the frameworks you have. The rest of the function stays as it is.
- Restart the server and type
/notifytestin game to see every type.
Your own scripts can also call AW Notify directly (see Exports and events), without any framework change.
qb-core/client/functions.lua: add this as the first line inside function QBCore.Functions.Notify(text, texttype, length, icon):
if GetResourceState('aw_notify') == 'started' then return exports['aw_notify']:Notify(text, texttype, length, nil, icon) end
qbx_core/client/functions.lua: add this as the first line inside function Notify(text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor):
if GetResourceState('aw_notify') == 'started' then return exports.aw_notify:Notify({ title = subTitle and text or nil, message = subTitle or text, type = notifyType, duration = duration, icon = notifyIcon, color = notifyIconColor }) end
ox_lib/resource/interface/client/notify.lua: add this as the first line inside function lib.notify(data):
if GetResourceState('aw_notify') == 'started' then return exports.aw_notify:Notify(data) end
es_extended/client/functions.lua: add this as the first line inside function ESX.ShowNotification(message, notifyType, length):
if GetResourceState('aw_notify') == 'started' then return exports['aw_notify']:Notify(message, notifyType, length) end
Good to know:
- The added line only takes over while aw_notify is running. Stop it and the old notifications come back.
- After you update qb-core, qbx_core, ox_lib or es_extended, add the line again.
- okokNotify and mythic_notify are picked up when those scripts are not running: their events and their exports
(exports['okokNotify']:Alert, exports['mythic_notify']:SendAlert / DoHudText / DoCustomHudText / PersistentHudText).