Skip to content

DestroyPlayerWebFrame

Closes a frame of the web interface on a player’s screen and frees the memory its page used.

A frame that is hidden with HidePlayerWebFrame stays alive - its page keeps running and keeps everything it loaded, which is what makes showing it again instant. A frame closed with this call is gone: its page ends, the memory it used is freed, it gives up the keyboard and the mouse, and IsPlayerWebFrameReady says false for it. ShowPlayerWebFrame makes it again, its page loaded from the start (and OnPlayerWebReady follows once it listens). Close the screens a player opens once - a character creator, a login, a long list - and hide the ones they open again and again.

Closing a frame that is not open does nothing and still answers true. A frame that draws one of the game’s interface pieces for the player (its chat, its scoreboard … - SetPlayerInterface) is made again at once by the game.

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".

DestroyPlayerWebFrame(pid, frame)
Parameter Type
pid number the player
frame string the frame’s name

true, or false, reason - the reason as a person reads it

-- the character creator is used once: close it for good when the player is done
function OnClientEvent(pid, name, payload, source)
if source == "creator" and name == "creator.done" then
DestroyPlayerWebFrame(pid, "creator")
end
end

HidePlayerWebFrame · ShowPlayerWebFrame · IsPlayerWebFrameReady · the Web interface group of the index