OPX//77
opx_infinityanimations

Events

Last updated on

Network and local events of the animations module.

The opx:on: events reach only code inside opx_infinity's client VM. The module also reads the platform's own open77:animations:* wire.

opx:net:animations:play

Client → server. Play request.

TriggerServerEvent('opx:net:animations:play', requestId, name, variant, opts)
  • requestId: number
  • name: string
  • variant: number — 0 for none
  • opts: table
    • loop: 'default' | 'loop' | 'once'
    • durationMs: number — 0 for none
    • cancelable, override

opx:net:animations:stop

Client → server. Stop request.

TriggerServerEvent('opx:net:animations:stop', requestId, override)

opx:net:animations:hello

Client → server. Asks which animations this server offers. Answered at most once a second.

TriggerServerEvent('opx:net:animations:hello')

opx:net:animations:offer

Server → client. The offered catalogue, after DISABLED and the platform's own list. Sent in parts (about 500 values each), because the whole catalogue in one event is past the client's 1 024-value decoder. The client assembles the parts with the same serial, then takes them in on its own thread.

RegisterNetEvent('opx:net:animations:offer', function(serial, part, parts, rows, duo) end)
  • serial: number — one per offer; a newer serial replaces a half-received one
  • part, parts: number — this part's index and the total (1..64)
  • rows: table[] — at most 256
    • a written row: { name, variants }
    • a platform profile: { name, label, category, kind, placement, prop, mode, clips, words } — mode = 'once' for a one-shot gesture
  • duo: table | false — on the last part only: what may be played with a nearby player
    • kinds: string[] — offered move ids (carry, carried, escort, escorted, give, heal, healed)
    • pairs: { { id, actor, target } } — offered shortcuts
    • any: boolean — any two profiles allowed

opx:net:animations:duo

Client → server. Invite the nearest player to an emote together. Same rate window as a play.

TriggerServerEvent('opx:net:animations:duo', spec)
  • spec: table — one of
    • { kind = 'carry' } — a paired move
    • { pair = 'talk' } — a SHARED.PAIRS shortcut
    • { actor = 'preach', target = 'armscrossed' } — any two profiles; actor is the asker's
Example
-- what the picker sends for "you dance, they clap"
TriggerServerEvent('opx:net:animations:duo', { actor = 'dance', target = 'clap' })

opx:net:animations:reply

Client → server. The invited player's answer. Only the invited player's own answer counts; on a yes the distance is measured again before the pair starts.

TriggerServerEvent('opx:net:animations:reply', inviteId, accepted)
  • inviteId: number — from invite
  • accepted: boolean

opx:net:animations:answer

Server → client. Verdict on a play or stop.

RegisterNetEvent('opx:net:animations:answer', function(requestId, action, ok, code, info) end)
  • requestId: number — 0 for one started by a command
  • action: string
  • ok: boolean
  • code: string?
  • info: { animation, variant, playbackId, cancelable, durationMs }

opx:net:animations:cancel

Server → client. /opx.anim.stop ran: release the local playback too.

RegisterNetEvent('opx:net:animations:cancel', function() end)

opx:net:animations:picker

Server → client. A command asked for the picker.

RegisterNetEvent('opx:net:animations:picker', function(category) end)
  • category: string — '' for none

opx:net:animations:invite

Server → client, to the invited player. Opens the Accept / Decline menu (or a chat line naming /e accept).

RegisterNetEvent('opx:net:animations:invite', function(inviteId, what, inviteMs) end)
  • inviteId: number
  • what: table — what was asked: { kind }, { pair, actor, target } or { actor, target } (actor is the asker's profile)
  • inviteMs: number — how long the invitation waits (SHARED.INVITE_MS)

Since PR #93 there is no name argument (it was the third, before inviteMs): the invited player reads The person next to you invites you: {emote}. A name sent by an older server is ignored.

opx:net:animations:uninvite

Server → client, to the invited player. The invitation expired or the asker withdrew it: close the menu.

RegisterNetEvent('opx:net:animations:uninvite', function(inviteId) end)

opx:net:animations:notice

Server → client. How an emote with a nearby player went, shown as a toast (or a chat line with NOTIFY = false).

RegisterNetEvent('opx:net:animations:notice', function(kind, code, params) end)
  • kind: 'info' | 'success' | 'warning' | 'error' — through OPX.Result.Kind: too_far is an error, too fast a warning
  • code: string — sent, accepted, declined, expired, or a refusal code (no_player_nearby, too_far…)
  • params: table — never a name since PR #93

opx:on:animations:result

Client, local. Every verdict, including request_timeout after 15 s with no answer.

AddEventHandler('opx:on:animations:result', function(result) end)
  • result: { requestId, action, ok, error?, animation?, variant?, playbackId?, source, owner? }

opx:on:animations:changed

Client, local. A player in the bucket started, changed or stopped an animation.

AddEventHandler('opx:on:animations:changed', function(state) end)
  • state: { playerId, active, playbackId?, animation?, clip?, variant?, known?, step?, steps?, cycle? }

opx:on:animations:failed

Client, local. A playback could not be posed on this client.

AddEventHandler('opx:on:animations:failed', function(info) end)
  • info: { playerId, playbackId, reason }

On this page