Notify
VORP ships 17 named notify styles. RSG Core has none of its own, so it delegates to ox_lib's single lib.notify. wc_libs gives you full access to every VORP variant on the client, maps each one down to RSG when needed, and includes server bridge helpers for notifying a player from server code.
Notify(opts)client
Sends a notification for the local player using whichever framework is active.
| Field | Type | Used by |
|---|---|---|
| variant | string | nil | Picks a VORP style. Defaults to 'avanced'. |
| title | string | All variants. |
| subtitle | string | nil | left, simpletop, fail, update, warning, leftrank, leftinteractive |
| dict / icon | string | nil | left, avanced, leftrank, leftinteractive |
| color | string | nil | left, avanced, leftrank, leftinteractive |
| duration | number | nil | All variants. Defaults to 4000ms (-1 on leftinteractive = stays on screen). |
| quality / showQuality | number / boolean | avanced only. |
| audioref / audioname | string | nil | dead, warning |
| second_description | string | nil | threesimpletop only |
| location | string | nil | top only |
Try it — pick a variant and a framework, see what wc_lib actually calls underneath:
underneath, on —
your code (same on both)
wc:Notify({
variant = 'righttip',
title = "Job updated: Marshal",
duration = 4000,
})
vorp_core — exact variant, full fidelity
Core.NotifyRightTip("Job updated: Marshal", 4000)
rsg — collapsed to ox_lib's one notify type
lib.notify({
title = "Job updated: Marshal",
type = 'inform',
duration = 4000,
})
Visual fidelity is intentionally asymmetric. VORP is the richer "main" experience this lib is built around — every one of its 17 variants is preserved exactly. RSG gets the closest reasonable fallback, not a 1:1 match, since ox_lib's notify just doesn't have that many distinct visual styles to map to.
Server bridge. From server code, call
wc:Notify(source, opts) to forward the same options to one player through wc_libs:client:notify. You can also call wc:WcNotify(source, msg, level, placement) to send through wc_notify:send.
server example
wc:Notify(source, {
variant = 'righttip',
title = "Job updated: Marshal",
duration = 4000,
})
wc:WcNotify(source, 'Reward accepted', 'SUCCESS')
WcTip(msg, duration, opts)client
Shows a compact wc_libs NUI toast prompt using nui/image/toast.png.
| Param | Type | Description |
|---|---|---|
| msg | string | Text displayed inside the toast. |
| duration | number | nil | Duration in milliseconds. Defaults to 3000. |
| opts | table | nil | Optional placement, y, and rtl overrides. |
client example
wc:WcTip('Help... somebody... please!', 3000)
wc:wctip('Bring the sack to the wagon.', 4000, {
y = '74vh',
})
Toast asset. Place the background image at
D:\wc_libs\nui\image\toast.png. For right-to-left styling, also provide toast-rtl.png.
NotifyIcon(source, text, icon, color, duration, dict?)server
Sends a VORP avanced-style notification with an item icon to a specific player from server code. Falls back to WcNotify if VORP is unavailable.
| Param | Type | Description |
|---|---|---|
| source | number | Server-side player source. |
| text | string | Notification text (e.g. "+$50"). |
| icon | string | Item icon key, e.g. 'itemtype_cash'. |
| color | string | Color name, e.g. 'COLOR_WHITE'. |
| duration | number | Display time in milliseconds. |
| dict | string | nil | Texture dictionary override. Defaults to 'itemtype_textures'. |
server example — cash reward
wc:NotifyIcon(source, "+$50", 'itemtype_cash', 'COLOR_WHITE', 3000)
Server-only. From the client, use
wc:Notify({ variant = 'avanced', ... }) instead.
Variant reference
Every VORP variant, and what it collapses to on RSG.
| variant | VORP call | RSG fallback type |
|---|---|---|
| avanced (default) | NotifyAvanced | success |
| left | NotifyLeft | inform |
| tip | NotifyTip | inform |
| righttip | NotifyRightTip | inform |
| objective | NotifyObjective | inform |
| top | NotifyTop | inform |
| simpletop | NotifySimpleTop | inform |
| center | NotifyCenter | inform |
| bottomright | NotifyBottomRight | inform |
| fail | NotifyFail | error |
| dead | NotifyDead | error |
| update | NotifyUpdate | success |
| warning | NotifyWarning | error |
| leftrank | NotifyLeftRank | success |
| onesimpletop | NotifyOneSimpleTop | inform |
| threesimpletop | NotifyThreeSimpleTop | inform |
| leftinteractive | NotifyLeftInteractive | inform |
example — money reward (default variant)
-- no variant specified — uses 'avanced', the default
wc:Notify({
title = "+$50",
icon = 'itemtype_cash',
color = 'COLOR_WHITE',
})
More examples
success
wc:Notify({ variant = 'update', title = "Delivery complete!" })
error
wc:Notify({ variant = 'fail', title = "You don't have enough cash." })
warning
wc:Notify({ variant = 'warning', title = "Your horse is close to exhaustion." })
broadcast to every connected player
-- server: loop GetPlayers() to reach everyone, since Notify targets one source at a time
for _, pid in ipairs(GetPlayers()) do
wc:WcNotify(tonumber(pid), 'Server restarting in 5 minutes.', 'WARNING')
end
Real Wild County example — trader sale confirmation
wc_trader/server/main.lua
wc:AddMoney(src, total, 0)
wc:Notify(src, {
variant = 'avanced',
title = ("+$%.2f"):format(total),
icon = 'itemtype_cash',
color = 'COLOR_WHITE',
})
Common mistakes
- Calling
wc:Notify(opts)(2 args) on the server — the server version needs a target:wc:Notify(source, opts). Withoutsourceit can't route to a player. - Expecting an RSG server to render 17 distinct notification styles — it collapses to ox_lib's much smaller type set (
inform/success/error) by design; don't design UX that depends on a VORP-only variant looking identical on RSG. - Assuming
WcTip/wctipwork without thetoast.pngNUI asset in place — see the asset note above. - Using
NotifyIconfrom the client — it's server-only; usewc:Notify({ variant = 'avanced', ... })client-side instead.
Troubleshooting
- If nothing shows up on RSG: confirm
ox_libis installed and started before wc_libs — RSG notify has no other fallback path. - If VORP notifications don't appear: check
vorp_coreactually started and that you're not passing an unknownvariantstring (it logs a console warning and falls back to'avanced'rather than failing silently). - If the server-side
wc:Notify(source, opts)does nothing: verifysourceis a valid, currently-connected player ID.