ShowPlayerWebFrame
Shows a frame of the web interface on a player’s screen.
The frame is made if it is not there yet (its page loads, then OnPlayerWebReady follows); a frame that was hidden
with HidePlayerWebFrame is drawn again as it was - the same page, no reload.
A request that arrives before the player’s game has the interface (its files are still being downloaded) waits for it,
up to half a minute, and is done in the order it was made. Showing a frame does not give it the keyboard or the mouse:
that is SetPlayerWebFocus.
The answer is true when the request was handed to the player’s game; false and the reason when it could not be:
"no such player", "no web interface", "the player has no web layer" or "no such frame".
Syntax
Section titled “Syntax”ShowPlayerWebFrame(pid, frame)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
frame |
string | the frame’s name, as ui.toml gives it |
Returns
Section titled “Returns”true, or false, reason - the reason as a person reads it ("no such frame", "the player has no web layer" …)
Example
Section titled “Example”function OnPlayerWebStatus(pid, status) if status == "ready" then local ok, why = ShowPlayerWebFrame(pid, "welcome") if not ok then Log("welcome: " .. why) end endendSee also
Section titled “See also”HidePlayerWebFrame · SetPlayerWebFocus · OnPlayerWebReady · IsPlayerWebFrameReady · the Web interface group of the index
