Debuggers: Updated messaging functions
This commit is contained in:
parent
b41bb3bb44
commit
90d68c57e4
@ -1064,20 +1064,25 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function HandleChunkStay(a_Split, a_Player)
|
function HandleChunkStay(a_Split, a_Player)
|
||||||
|
-- As an example of using ChunkStay, this call will load 3x3 chunks around the specified chunk coords,
|
||||||
|
-- then build an obsidian pillar in the middle of each one.
|
||||||
|
-- Once complete, the player will be teleported to the middle pillar
|
||||||
|
|
||||||
if (#a_Split ~= 3) then
|
if (#a_Split ~= 3) then
|
||||||
a_Player:SendMessage("Usage: /cs <ChunkX> <ChunkZ>")
|
a_Player:SendMessageInfo("Usage: /cs <ChunkX> <ChunkZ>")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local ChunkX = tonumber(a_Split[2])
|
local ChunkX = tonumber(a_Split[2])
|
||||||
local ChunkZ = tonumber(a_Split[3])
|
local ChunkZ = tonumber(a_Split[3])
|
||||||
if ((ChunkX == nil) or (ChunkZ == nil)) then
|
if ((ChunkX == nil) or (ChunkZ == nil)) then
|
||||||
a_Player:SendMessage("Invalid chunk coords.")
|
a_Player:SendMessageFailure("Invalid chunk coords.")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local World = a_Player:GetWorld()
|
local World = a_Player:GetWorld()
|
||||||
local PlayerID = a_Player:GetUniqueID()
|
local PlayerID = a_Player:GetUniqueID()
|
||||||
|
a_Player:SendMessageInfo("Loading chunks, stand by...");
|
||||||
|
|
||||||
-- Set the wanted chunks:
|
-- Set the wanted chunks:
|
||||||
local Chunks = {}
|
local Chunks = {}
|
||||||
@ -1103,7 +1108,7 @@ function HandleChunkStay(a_Split, a_Player)
|
|||||||
World:DoWithEntityByID(PlayerID,
|
World:DoWithEntityByID(PlayerID,
|
||||||
function (a_CallbackPlayer)
|
function (a_CallbackPlayer)
|
||||||
a_CallbackPlayer:TeleportToCoords(ChunkX * 16 + 8, 85, ChunkZ * 16 + 8)
|
a_CallbackPlayer:TeleportToCoords(ChunkX * 16 + 8, 85, ChunkZ * 16 + 8)
|
||||||
a_CallbackPlayer:SendMessage("ChunkStay fully available")
|
a_CallbackPlayer:SendMessageSuccess("ChunkStay fully available")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@ -1114,7 +1119,7 @@ function HandleChunkStay(a_Split, a_Player)
|
|||||||
LOGINFO("ChunkStay now has chunk [" .. a_ChunkX .. ", " .. a_ChunkZ .. "]")
|
LOGINFO("ChunkStay now has chunk [" .. a_ChunkX .. ", " .. a_ChunkZ .. "]")
|
||||||
World:DoWithEntityByID(PlayerID,
|
World:DoWithEntityByID(PlayerID,
|
||||||
function (a_CallbackPlayer)
|
function (a_CallbackPlayer)
|
||||||
a_CallbackPlayer:SendMessage("ChunkStay now has chunk [" .. a_ChunkX .. ", " .. a_ChunkZ .. "]")
|
a_CallbackPlayer:SendMessageInfo("ChunkStay now has chunk [" .. a_ChunkX .. ", " .. a_ChunkZ .. "]")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user