Events
Last updated on
Network, local and host-wide events and page channels of the downed module.
opx:net:downed:state
Server → client. The player's down state. All times are relative.
RegisterNetEvent('opx:net:downed:state', function(state) end)- state:
table—{ down, waiting?, downForMs?, giveUpInMs?, waitingForMs? }
opx:net:downed:refused
Server → client. A give-up was refused. Shown as medic.refused.<code>.
RegisterNetEvent('opx:net:downed:refused', function(code) end)- code:
string— see Refusal codes
opx:net:downed:ready
Client → server. Ask for the state again (on start and world entry).
TriggerServerEvent('opx:net:downed:ready')opx:net:downed:wait
Client → server. Wait for help. Marks the player as waiting.
TriggerServerEvent('opx:net:downed:wait')opx:net:downed:giveup
Client → server. Give up. The server checks the delay, that the player is still dead and the readiness gate, then respawns at the nearest hospital in the same bucket.
TriggerServerEvent('opx:net:downed:giveup')opx:on:downed:changed
Client, local, and server, host-wide. Down or waiting changed. On the client, hud, prompts, target, progress and appearance react to it. On the server every server resource hears it; see Public server events.
-- client
AddEventHandler('opx:on:downed:changed', function(state) end)
-- server
AddEventHandler('opx:on:downed:changed', function(playerId, payload) end)- Client — state:
table{ down, waiting } - Server — playerId:
integer; payload:table{ citizenId, down = true, waiting, restored }- or
{ citizenId, down = false, reason, kept }
opx:on:downed:view
Client, local. The state half talking to the view.
AddEventHandler('opx:on:downed:view', function(message) end)- message:
table—{ kind, ... };kind:config,show,hide,noticeorfocus
opx:on:downed:key
Client, local. A key pressed while the down screen holds the keyboard. Key mappings do not fire then, so this is how another module hears one.
AddEventHandler('opx:on:downed:key', function(key) end)- key:
string—F1–F12,A–Z,0–9
Page channels
On the interactive surface.