OPX//77
opx_infinityprogress

Events

Last updated on

Network and local events and page channels of the progress module.

A server module starts a bar through the server contract, which numbers it, sends opx:net:progress:start, and judges the client's report by its own clock.

opx:net:progress:start

Server → client. Starts a bar owned by @server. A client Stop cannot end it.

TriggerClientEvent('opx:net:progress:start', playerId, spec)
  • spec: table — as in Start, plus id when the server wants to hear how it ended

opx:net:progress:cancel

Server → client. Ends a bar owned by @server with stopped.

TriggerClientEvent('opx:net:progress:cancel', playerId, id)
  • id?: integer — only that bar; a stop for an older bar leaves the one up alone

opx:net:progress:report

Client → server. How a numbered bar ended: refused at once when the client cannot draw it, or the bar's ending. The server believes only the ending, never the timing.

TriggerServerEvent('opx:net:progress:report', id, ending)

opx:on:progress:finished

Server, host-wide. The server's verdict on a bar it started. See Public server events.

AddEventHandler('opx:on:progress:finished', function(playerId, payload) end)
  • payload: { id, owner, ending, completed, elapsedMs } — only completed = true means the action happened

opx:on:progress:done

Client, local. The bar ended.

AddEventHandler('opx:on:progress:done', function(done) end)
  • done: table
    • owner, label: string
    • ending: string — finished, stopped, cancelled or interrupted
    • finished: boolean — only true means the action happened

opx:on:progress:state

Client, local. A bar went up or down.

AddEventHandler('opx:on:progress:state', function(state) end)
  • state: table — { open, owner?, label? }

Page channels

On the overlay surface.

ChannelDirectionPayloadMeaning
progress:showLua → page{ label, durationMs, cancelable, cancelKey }Show the bar; the page animates from the duration. cancelable is true only when the bar allows it and the cancel key is registered; cancelKey is the bound key's label (drawn in the hint).
progress:hideLua → page{}Hide the bar.
progress:cancelpage → Lua—Removed. The player cancels with CANCEL_KEY instead.

On this page