OnPlayerMapReady
A player’s game has the server’s map - or could not get it.
Runs once a join on a server with a map, as soon as the player’s game says where it stands: "drawn" - every object and
removal is in their game (it comes before their spawn: their game holds the spawn until then, for up to a minute) -, "failed"
(the download or the drawing failed; reason says why) or "unsupported" (their game cannot draw a map at all). A player
whose game failed plays without the map - they may walk through what was placed and see what was removed; a mode whose world
needs the map can tell them or Kick them.
Syntax
Section titled “Syntax”function OnPlayerMapReady(pid, state, reason) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
state |
string | "drawn", "failed" or "unsupported" |
reason |
string | why it failed ("" when drawn) |
Example
Section titled “Example”function OnPlayerMapReady(pid, state, reason) if state ~= "drawn" then SendClientMessage(pid, COLOR_RED, "Your game could not load this server's map (" .. reason .. ") - rejoin to try again.") endendSee also
Section titled “See also”GetMapInfo · the The server’s map group of the index
