Events
Last updated on
The net events the core itself sends and listens to, the host event names in OPX.Host, the core's WebUI page channels, and its private internal events.
The core's own events, outside any module: refusals and command answers going to a player, notes coming back to the server journal, and the WebUI channels every view shares. Use this page for the exact name or payload, e.g. to draw command answers in a custom chat. Module events are on each module's events page; the three prefixes are explained in Events and channels.
The core calls itself runtime on the net channel: opx:net:runtime:<verb>.
Net events
opx:net:runtime:notify
Server → client. A refusal, sent by OPX.Refuse. The client shows locale(code, params) as a toast of kind; an icon outside OPX.Glyphs is dropped, and so is a param that is not a string or a number.
RegisterNetEvent('opx:net:runtime:notify', function(payload) end)- payload:
table- kind:
'error' | 'warning'— fromOPX.Result.Kind - code:
string— always a locale key that exists - params?:
table<string, string | number>— at most 8, strings cut to 64 bytes - operation:
string - icon?:
string
- kind:
opx:net:runtime:commandAnswer
Server → client. What a command did, sent by OPX.CommandNotice. The client shows message as a toast with id opx.command (a new answer replaces the last one), unless toasted is true.
RegisterNetEvent('opx:net:runtime:commandAnswer', function(raw, kind, message, toasted, icon) end)- raw:
string - kind:
string - message:
string - toasted:
boolean - icon?:
string
opx:net:runtime:commandResult
Server → client. A command's read-back (a list or a dump), sent by OPX.CommandResult. The chat module draws it, styled by kind; with no listener nothing is shown.
RegisterNetEvent('opx:net:runtime:commandResult', function(line) end)- line:
table- kind:
'info' | 'error' - author:
string—SERVER_NAME - text:
string
- kind:
opx:net:runtime:note
Client → server. One line for the server journal, sent by OPX.Note. Evidence only: nothing reads it back.
TriggerServerEvent('opx:net:runtime:note', module, text)- module:
string— 1–32 characters matching^[a-z0-9][a-z0-9_.-]*$, else dropped - text:
string— 1–2048 bytes, else dropped; stripped of control characters and cut to 400 characters
The server allows 12 per player per 10 s and 60 per session.
Any client can raise opx:net:runtime:note. Do not act on what it says.
Host events (OPX.Host)
OPX.Host names the platform's own events, so code does not spell them by hand.
| Key | Event name | Side the core uses it on |
|---|---|---|
PLAYER_CONNECTED | onPlayerConnected | server |
PLAYER_DISCONNECTED | onPlayerDisconnected | server — the core clears notes, cooldowns and any session left behind |
PLAYER_READY | onPlayerReady | server — the core warns when the host opened a gate the core was holding (liveness_lost: or timeout:), or when it was never held (no_holds) |
CLIENT_RESOURCE_START | onClientResourceStart | client — client boot |
CLIENT_RESOURCE_STOP | onClientResourceStop | client — client shutdown |
RESOURCE_START | onResourceStart | server |
RESOURCE_STOP | onResourceStop | server — stops jobs and modules, releases selection buckets |
WORLD_READY | open77:worldReady | — |
GAMEPLAY_READY | open77:session:gameplayReady | — the platform's own gate hold clears only after a client sends it |
VEHICLE_REMOVED | onVehicleRemoved | — |
TUNABLE_CHANGED | onTunableChanged | server — re-raised as opx:in:tune:changed |
KEYBINDS_CHANGED | open77:keybinds:changed | client, no payload — raised after any key mapping is registered, rebound, reset or removed. Every module that shows a key name (admin, animations, clothing, dealership, garages, inventory, prompts, teleports) listens to this one constant to redraw. |
The server and client pairs are different names: CLIENT_RESOURCE_START on the server registers a handler nothing raises.
Page channels
The runtime has one WebUI page, id opx. Lua sends and listens on <channel>; the page sees opx:<channel> (The WebUI page).
Page → Lua
Lua → page
| Channel | Payload | Meaning |
|---|---|---|
locale:set | { locale, strings, first, done } | The locale catalogue, in parts of 250 keys, one part per frame. first clears the page's copy; done marks the last part. |
reply | { ref, ... } | The answer to a page request, from OPX.UI.Answer. |
notify:config | { position, width } | From TOASTS. |
notify:show | { id, kind, title, message, icon, durationMs, stinger } | Show or replace a toast. |
notify:update | the whole toast | A toast changed. |
notify:dismiss | { id } | Take one toast down. |
notify:clear | {} | Take every toast down. |
notify:down | { down } | Hide or show the toast stacks. |
Internal events
Private to opx_infinity, raised with TriggerEvent on the server. A server TriggerEvent reaches every server resource, so another resource can hear them, but they are not a supported API and may change.
| Event | Arguments | Raised when |
|---|---|---|
opx:in:gate:held | source | OPX.Gate.Hold took a hold. No module listens to it in this version. |
opx:in:gate:released | source, note | OPX.Gate.Release released one. No module listens to it in this version. |
opx:in:session:forgotten | playerId | OPX.ForgetSession is dropping a session. The character module unloads on it. |
opx:in:tune:changed | key | The host reported a tunable change. No module listens to it in this version: read tunables with OPX.Tune.Number at the moment of use. |
Configuration
Every key of config/shared.lua, config/server.lua and config/client.lua — the runtime's own settings, outside any module — with its shipped default.
Shared library (lib/)
Every helper in opx_infinity's lib/ directory — results, text, numbers, validation, hooks, locales, citizen ids, job gates, placed spots, storage, audit logging and the WebUI surface.