OnPlayerWebStatus
A player’s web layer changed state - or the state it had when the player joined.
status is one of four words: "off" (the player’s game runs no web layer: an older game, or the player turned server
interfaces off), "starting", "ready" and "failed", and then reason says why in a short text from the player’s
game (empty for the other three). Show frames from "ready" on (a request made while the layer is "starting" is
accepted and waits for it); a "failed" or "off" player keeps the standard interface and needs a mode that has
something else for them - see RegisterUiFallback.
The callback also runs once right after OnPlayerConnect with the state the player’s game reported as it joined -
not for a player whose game reported none. A layer that flips between states faster than twelve times and then once
every two seconds is not announced every time (the server log says so); IsPlayerWebReady always has the newest state.
Syntax
Section titled “Syntax”function OnPlayerWebStatus(pid, status, reason) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
status |
string | "off", "starting", "ready" or "failed" |
reason |
string | why the layer failed, as a short text from the player’s game; "" for the other states |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnPlayerWebStatus(pid, status, reason) if status == "ready" then ShowPlayerWebFrame(pid, "hud") elseif status == "failed" then Log(GetPlayerName(pid) .. "'s web layer failed: " .. reason) endendSee also
Section titled “See also”IsPlayerWebReady · OnPlayerWebReady · ShowPlayerWebFrame · RegisterUiFallback · the Web interface group of the index
