IsPlayerWebReady
Whether a player’s game runs the web layer and it is ready.
true only in the state "ready" (see OnPlayerWebStatus); false for "off", "starting" and "failed" and for a
player who is not connected. It is the question to ask before a mode counts on a frame: a player without the web layer
needs the same thing said in the chat or by a screen of a client script.
Syntax
Section titled “Syntax”IsPlayerWebReady(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”boolean - true when the player’s web layer is ready
Example
Section titled “Example”function OnPlayerCommandText(pid, cmd, args) if cmd == "shop" then if IsPlayerWebReady(pid) then ShowPlayerWebFrame(pid, "shop") else SendClientMessage(pid, COLOR_RED, "The shop window needs the web interface - use /buy in the chat instead.") end return true end return falseendSee also
Section titled “See also”OnPlayerWebStatus · IsPlayerWebFrameReady · ShowPlayerWebFrame · the Web interface group of the index
