Events
Last updated on
Network and local events and page channels of the spawn module.
opx:net:spawn:offer
Server → client. A choice is open. The client ignores a second offer while one is open.
RegisterNetEvent('opx:net:spawn:offer', function(offer) end)- offer:
table—{ timeoutMs, resume }- resume:
boolean— the character's row holds a position: the client shows a first card, Where I left off, with id'resume'
- resume:
opx:net:spawn:opened
Client → server. The menu is on screen; the player's window starts now. Only the first report counts.
TriggerServerEvent('opx:net:spawn:opened', {})opx:net:spawn:waiting
Client → server. The join is still busy ahead of the menu (name form or fitting room up, an offer waiting). Sent every 30 s; the server takes one per 5 s. Pushes the hold on by HOLD_MAX_SECONDS, up to 30 minutes from the offer. Ignored once the menu has opened.
TriggerServerEvent('opx:net:spawn:waiting')opx:net:spawn:choose
Client → server. The place clicked. Unknown ids are refused (spawn.noChoice) and the menu stays up. id = 'resume' keeps the row's position; it is refused the same way when the offer had no resume. Cooldown CHOOSE_COOLDOWN_MS.
TriggerServerEvent('opx:net:spawn:choose', { id = placeId })- id:
string
opx:net:spawn:close
Server → client. Sent twice per choice. The first ({ reason }) takes the menu down before the body moves and says nothing. The second (result = true) comes after the placement: the client toasts Spawned at {place}, Back where you left off, the timeout line, or, when placed is false, You could not be moved there.
RegisterNetEvent('opx:net:spawn:close', function(result) end)- result:
tablereason:string—'chosen','resumed'or'timeout'result?:true— on the second message onlyplaced?:boolean— second message: whether the body was movedplace?:string— second message: the label chosen (config text)placeId?:string— second message: its id; the client showsspawn.place.<id>when the catalogue has it
opx:on:spawn:state
Client, local. { open = true, phase = 'spawn' } when the menu opens, { open = false, phase = 'idle' } when it closes. Same shape as opx:on:entry:state.
AddEventHandler('opx:on:spawn:state', function(state) end)- state:
table—{ open, phase }
Page channels
On the interactive surface.