OPX//77
opx_infinitychat

Events

Last updated on

Network and local events, host events and page channels of the chat module.

opx:net:chat:say

Client → server. A chat line. Refused with chat.notLoaded when the sender has no loaded character and no STAFF_PERMISSION. Dropped if blank, or within RATE_MS of the sender's last one (then refused with chat.tooFast, once per burst); cut to MAX_LENGTH; broadcast to every player.

TriggerServerEvent('opx:net:chat:say', text)
  • text: string

opx:net:chat:ready

Client → server. The input line is up; asks for command completions. Answered at most once per READY_MS.

TriggerServerEvent('opx:net:chat:ready')

opx:net:chat:message

Server → client. A line to add to the log.

RegisterNetEvent('opx:net:chat:message', function(line) end)
  • line: table — { kind = 'chat', author, text }
    • author: Player #<id> (chat.author.player), the sender's server id. Never a name.

opx:net:chat:suggestions

Server → client. Every command registered through OPX.Command.Register that this player may run.

RegisterNetEvent('opx:net:chat:suggestions', function(payload) end)
  • payload: table — { suggestions = { { name, help, params }, … } }

opx:net:runtime:commandResult

Server → client. Core's command read-back (OPX.CommandResult, used by /opx.anim.list, /opx.elevators.where and others). Chat draws it in the log.

RegisterNetEvent('opx:net:runtime:commandResult', function(line) end)
  • line: table
    • kind: 'info' | 'error' (was type before)
    • author: string — the server name
    • text: string

opx:on:chat:view

Client, local. The seam between the state and the view; every update to the page passes here.

AddEventHandler('opx:on:chat:view', function(payload) end)
  • payload: table — { kind, surface, … }

Host events

The client half uses:

  • open77:command:execute — sends a command.
  • open77:command:result — refusals become toasts.
  • open77:chat:open — open the box; raised by the T mapping and by the platform's open77_chat if loaded.
  • open77:pauseKey — closes the box.

Page channels

The log lives on the overlay surface, the input line on the interactive surface.

ChannelDirectionPayloadMeaning
chat:readypage → Lua{ surface }That half of the page is up; Lua sends its config (and completions for the input line).
chat:submitpage → Lua{ text }The player pressed Enter.
chat:closepage → Lua{}Escape in the input line.
chat:diagpage → Lua{ text }Written to the client log.
chat:viewLua → page{ kind, surface, … }kind: config, line, clear, visible, open, close, focus, suggest, unsuggest or suggestions.

On this page