ProtectionAreas: Moved all strings sent to players to a separate language file
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1579 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
c6ddc89e92
commit
30924db508
@ -21,19 +21,19 @@ end
|
|||||||
function HandleAddArea(a_Split, a_Player)
|
function HandleAddArea(a_Split, a_Player)
|
||||||
-- Command syntax: ProtAdd username1 [username2] [username3] ...
|
-- Command syntax: ProtAdd username1 [username2] [username3] ...
|
||||||
if (#a_Split < 2) then
|
if (#a_Split < 2) then
|
||||||
a_Player:SendMessage("Not enough parameters. Expected a list of usernames.");
|
a_Player:SendMessage(g_Msgs.ErrExpectedListOfUsernames);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get the cuboid that the player had selected
|
-- Get the cuboid that the player had selected
|
||||||
local CmdState = GetCommandStateForPlayer(a_Player);
|
local CmdState = GetCommandStateForPlayer(a_Player);
|
||||||
if (CmdState == nil) then
|
if (CmdState == nil) then
|
||||||
a_Player:SendMessage("Cannot add area, internal plugin error (CmdState == nil)");
|
a_Player:SendMessage(g_Msgs.ErrCmdStateNilAddArea);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
local Cuboid = CmdState:GetCurrentCuboid();
|
local Cuboid = CmdState:GetCurrentCuboid();
|
||||||
if (Cuboid == nil) then
|
if (Cuboid == nil) then
|
||||||
a_Player:SendMessage("Cannot add area, no area has been selected. Use a ProtWand lclk / rclk to select area first");
|
a_Player:SendMessage(g_Msgs.ErrNoAreaWanded);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ function HandleAddArea(a_Split, a_Player)
|
|||||||
|
|
||||||
-- Add the area to the storage
|
-- Add the area to the storage
|
||||||
local AreaID = g_Storage:AddArea(Cuboid, a_Player:GetWorld():GetName(), a_Player:GetName(), AllowedNames);
|
local AreaID = g_Storage:AddArea(Cuboid, a_Player:GetWorld():GetName(), a_Player:GetName(), AllowedNames);
|
||||||
a_Player:SendMessage("Area added, ID " .. AreaID);
|
a_Player:SendMessage(string.format(g_Msgs.AreaAdded, AreaID));
|
||||||
|
|
||||||
-- Reload all currently logged in players
|
-- Reload all currently logged in players
|
||||||
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
||||||
@ -60,7 +60,7 @@ end
|
|||||||
function HandleAddAreaCoords(a_Split, a_Player)
|
function HandleAddAreaCoords(a_Split, a_Player)
|
||||||
-- Command syntax: ProtAddCoords x1 z1 x2 z2 username1 [username2] [username3] ...
|
-- Command syntax: ProtAddCoords x1 z1 x2 z2 username1 [username2] [username3] ...
|
||||||
if (#a_Split < 6) then
|
if (#a_Split < 6) then
|
||||||
a_Player:SendMessage("Not enough parameters. Expected <x1> <z1> <x2> <z2> coords and a list of usernames.");
|
a_Player:SendMessage(g_Msgs.ErrExpectedCoordsUsernames);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ function HandleAddAreaCoords(a_Split, a_Player)
|
|||||||
local x1, z1 = tonumber(a_Split[2]), tonumber(a_Split[3]);
|
local x1, z1 = tonumber(a_Split[2]), tonumber(a_Split[3]);
|
||||||
local x2, z2 = tonumber(a_Split[4]), tonumber(a_Split[5]);
|
local x2, z2 = tonumber(a_Split[4]), tonumber(a_Split[5]);
|
||||||
if ((x1 == nil) or (z1 == nil) or (x2 == nil) or (z2 == nil)) then
|
if ((x1 == nil) or (z1 == nil) or (x2 == nil) or (z2 == nil)) then
|
||||||
a_Player:SendMessage("Cannot parse coords.");
|
a_Player:SendMessage(g_Msgs.ErrParseCoords);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
local Cuboid = cCuboid(x1, 0, z1, x2, 255, z1);
|
local Cuboid = cCuboid(x1, 0, z1, x2, 255, z1);
|
||||||
@ -82,7 +82,7 @@ function HandleAddAreaCoords(a_Split, a_Player)
|
|||||||
|
|
||||||
-- Add the area to the storage
|
-- Add the area to the storage
|
||||||
local AreaID = g_Storage:AddArea(Cuboid, a_Player:GetWorld():GetName(), a_Player:GetName(), AllowedNames);
|
local AreaID = g_Storage:AddArea(Cuboid, a_Player:GetWorld():GetName(), a_Player:GetName(), AllowedNames);
|
||||||
a_Player:SendMessage("Area added, ID = " .. AreaID);
|
a_Player:SendMessage(string.format(g_Msgs.AreaAdded, AreaID));
|
||||||
|
|
||||||
-- Reload all currently logged in players
|
-- Reload all currently logged in players
|
||||||
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
||||||
@ -97,7 +97,7 @@ end
|
|||||||
function HandleAddAreaUser(a_Split, a_Player)
|
function HandleAddAreaUser(a_Split, a_Player)
|
||||||
-- Command syntax: ProtAddUser AreaID username1 [username2] [username3] ...
|
-- Command syntax: ProtAddUser AreaID username1 [username2] [username3] ...
|
||||||
if (#a_Split < 3) then
|
if (#a_Split < 3) then
|
||||||
a_Player:SendMessage("Not enough parameters. Expected <AreaID> and a list of usernames.");
|
a_Player:SendMessage(g_Msgs.ErrExpectedAreaIDUsernames);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -112,13 +112,13 @@ function HandleAddAreaUser(a_Split, a_Player)
|
|||||||
tonumber(a_Split[2]), a_Player:GetWorld():GetName(), a_Player:GetName(), AllowedNames))
|
tonumber(a_Split[2]), a_Player:GetWorld():GetName(), a_Player:GetName(), AllowedNames))
|
||||||
) then
|
) then
|
||||||
LOGWARNING("g_Storage:AddAreaUsers failed");
|
LOGWARNING("g_Storage:AddAreaUsers failed");
|
||||||
a_Player:SendMessage("Cannot add users, DB failure");
|
a_Player:SendMessage(g_Msgs.ErrDBFailAddUsers);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
if (#AllowedNames == 0) then
|
if (#AllowedNames == 0) then
|
||||||
a_Player:SendMessage("All the specified users were already allowed.");
|
a_Player:SendMessage(g_Msgs.AllUsersAlreadyAllowed);
|
||||||
else
|
else
|
||||||
a_Player:SendMessage("Users added: " .. table.concat(AllowedNames, ", "));
|
a_Player:SendMessage(string.format(g_Msgs.UsersAdded, table.concat(AllowedNames, ", ")));
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reload all currently logged in players
|
-- Reload all currently logged in players
|
||||||
@ -134,20 +134,21 @@ end
|
|||||||
function HandleDelArea(a_Split, a_Player)
|
function HandleDelArea(a_Split, a_Player)
|
||||||
-- Command syntax: ProtDelArea AreaID
|
-- Command syntax: ProtDelArea AreaID
|
||||||
if (#a_Split ~= 2) then
|
if (#a_Split ~= 2) then
|
||||||
a_Player:SendMessage("Parameter mismatch. Expected <AreaID>.");
|
a_Player:SendMessage(g_Msgs.ErrExpectedAreaID);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Parse the AreaID
|
-- Parse the AreaID
|
||||||
local AreaID = tonumber(a_Split[2]);
|
local AreaID = tonumber(a_Split[2]);
|
||||||
if (AreaID == nil) then
|
if (AreaID == nil) then
|
||||||
a_Player:SendMessage("Cannot parse <AreaID>.");
|
a_Player:SendMessage(g_Msgs.ErrParseAreaID);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Delete the area
|
-- Delete the area
|
||||||
g_Storage:DelArea(a_Player:GetWorld():GetName(), AreaID);
|
g_Storage:DelArea(a_Player:GetWorld():GetName(), AreaID);
|
||||||
|
|
||||||
|
a_Player:SendMessage(string.format(g_Msgs.AreaDeleted, AreaID));
|
||||||
-- Reload all currently logged in players
|
-- Reload all currently logged in players
|
||||||
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
||||||
|
|
||||||
@ -161,9 +162,9 @@ end
|
|||||||
function HandleGiveWand(a_Split, a_Player)
|
function HandleGiveWand(a_Split, a_Player)
|
||||||
local NumGiven = a_Player:GetInventory():AddItem(cConfig:GetWandItem());
|
local NumGiven = a_Player:GetInventory():AddItem(cConfig:GetWandItem());
|
||||||
if (NumGiven == 1) then
|
if (NumGiven == 1) then
|
||||||
a_Player:SendMessage("Wand given");
|
a_Player:SendMessage(g_Msgs.WandGiven);
|
||||||
else
|
else
|
||||||
a_Player:SendMessage("Cannot give wand, no space in your inventory");
|
a_Player:SendMessage(g_Msgs.ErrNoSpaceForWand);
|
||||||
end
|
end
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
@ -180,12 +181,12 @@ function HandleListAreas(a_Split, a_Player)
|
|||||||
-- Get the last "wanded" coord
|
-- Get the last "wanded" coord
|
||||||
local CmdState = GetCommandStateForPlayer(a_Player);
|
local CmdState = GetCommandStateForPlayer(a_Player);
|
||||||
if (CmdState == nil) then
|
if (CmdState == nil) then
|
||||||
a_Player:SendMessage("Cannot list area, internal plugin error (CmdState == nil)");
|
a_Player:SendMessage(g_Msgs.ErrCmdStateNilListAreas);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
x, z = CmdState:GetLastCoords();
|
x, z = CmdState:GetLastCoords();
|
||||||
if ((x == nil) or (z == nil)) then
|
if ((x == nil) or (z == nil)) then
|
||||||
a_Player:SendMessage("Cannot list areas, no query point has been selected. Use a ProtWand lclk / rclk to select a point first");
|
a_Player:SendMessage(g_Msgs.ErrListNotWanded);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
elseif (#a_Split == 3) then
|
elseif (#a_Split == 3) then
|
||||||
@ -193,36 +194,34 @@ function HandleListAreas(a_Split, a_Player)
|
|||||||
x = tonumber(a_Split[2]);
|
x = tonumber(a_Split[2]);
|
||||||
z = tonumber(a_Split[3]);
|
z = tonumber(a_Split[3]);
|
||||||
if ((x == nil) or (z == nil)) then
|
if ((x == nil) or (z == nil)) then
|
||||||
a_Player:SendMessage("Cannot list areas, cannot parse coords in params");
|
a_Player:SendMessage(g_Msgs.ErrParseCoordsListAreas);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Wrong number of params, report back to the user
|
-- Wrong number of params, report back to the user
|
||||||
a_Player:SendMessage("Cannot list areas, syntax error. Expected either no params or <x> <z>.");
|
a_Player:SendMessage(g_Msgs.ErrSyntaxErrorListAreas);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
a_Player:SendMessage("Listing protection areas intersecting block column {" .. x .. ", " .. z .. "}:");
|
a_Player:SendMessage(string.format(g_Msgs.ListAreasHeader, x, z));
|
||||||
|
|
||||||
-- List areas intersecting the coords
|
-- List areas intersecting the coords
|
||||||
local PlayerName = a_Player:GetName();
|
local PlayerName = a_Player:GetName();
|
||||||
local WorldName = a_Player:GetWorld():GetName();
|
local WorldName = a_Player:GetWorld():GetName();
|
||||||
g_Storage:ForEachArea(x, z, WorldName,
|
g_Storage:ForEachArea(x, z, WorldName,
|
||||||
function(AreaID, MinX, MinZ, MaxX, MaxZ, CreatorName)
|
function(AreaID, MinX, MinZ, MaxX, MaxZ, CreatorName)
|
||||||
local Coords = AreaID .. ": {" ..
|
local Coords = string.format("%s: {%d, %d} - {%d, %d} ", AreaID, MinX, MinZ, MaxX, MaxZ);
|
||||||
MinX .. ", " .. MinZ .. "} - {" ..
|
|
||||||
MaxX .. ", " .. MaxZ .. "} ";
|
|
||||||
local Allowance;
|
local Allowance;
|
||||||
if (g_Storage:IsAreaAllowed(AreaID, PlayerName, WorldName)) then
|
if (g_Storage:IsAreaAllowed(AreaID, PlayerName, WorldName)) then
|
||||||
Allowance = "Allowed";
|
Allowance = g_Msgs.AreaAllowed;
|
||||||
else
|
else
|
||||||
Allowance = "NOT allowed";
|
Allowance = g_Msgs.AreaNotAllowed;
|
||||||
end
|
end
|
||||||
a_Player:SendMessage(" " .. Coords .. Allowance .. ", Created by " .. CreatorName);
|
a_Player:SendMessage(string.format(g_Msgs.ListAreasRow, Coords, Allowance, CreatorName));
|
||||||
end
|
end
|
||||||
);
|
);
|
||||||
|
|
||||||
a_Player:SendMessage("Area list finished");
|
a_Player:SendMessage(g_Msgs.ListAreasFooter);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -233,7 +232,7 @@ end
|
|||||||
function HandleListUsers(a_Split, a_Player)
|
function HandleListUsers(a_Split, a_Player)
|
||||||
-- Command syntax: ProtListUsers AreaID
|
-- Command syntax: ProtListUsers AreaID
|
||||||
if (#a_Split ~= 2) then
|
if (#a_Split ~= 2) then
|
||||||
a_Player:SendMessage("Expected AreaID as a parameter");
|
a_Player:SendMessage(g_Msgs.ErrExpectedAreaID);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get the general info about the area
|
-- Get the general info about the area
|
||||||
@ -241,29 +240,24 @@ function HandleListUsers(a_Split, a_Player)
|
|||||||
local WorldName = a_Player:GetWorld():GetName();
|
local WorldName = a_Player:GetWorld():GetName();
|
||||||
local MinX, MinZ, MaxX, MaxZ, CreatorName = g_Storage:GetArea(AreaID, WorldName);
|
local MinX, MinZ, MaxX, MaxZ, CreatorName = g_Storage:GetArea(AreaID, WorldName);
|
||||||
if (MinX == nil) then
|
if (MinX == nil) then
|
||||||
a_Player:SendMessage("No such area: " .. AreaID);
|
a_Player:SendMessage(string.format(g_Msgs.ErrNoSuchArea, AreaID));
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Send the header
|
-- Send the header
|
||||||
a_Player:SendMessage(
|
a_Player:SendMessage(string.format(g_Msgs.ListUsersHeader, AreaID, MinX, MinZ, MaxX, MaxZ, CreatorName));
|
||||||
"Area ID " .. AreaID .. ": {" ..
|
|
||||||
MinX .. ", " .. MinZ .. "} - {" ..
|
|
||||||
MaxX .. ", " .. MaxZ .. "} " ..
|
|
||||||
"Created by " .. CreatorName .. "; allowed users:"
|
|
||||||
);
|
|
||||||
|
|
||||||
-- List and count the allowed users
|
-- List and count the allowed users
|
||||||
local NumUsers = 0;
|
local NumUsers = 0;
|
||||||
g_Storage:ForEachUserInArea(AreaID, WorldName,
|
g_Storage:ForEachUserInArea(AreaID, WorldName,
|
||||||
function(UserName)
|
function(UserName)
|
||||||
a_Player:SendMessage(" " .. UserName);
|
a_Player:SendMessage(string.format(g_Msgs.ListUsersRow, UserName));
|
||||||
NumUsers = NumUsers + 1;
|
NumUsers = NumUsers + 1;
|
||||||
end
|
end
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Send the footer
|
-- Send the footer
|
||||||
a_Player:SendMessage("End of area " .. AreaID .. " user list, total " .. NumUsers .. " users");
|
a_Player:SendMessage(string.format(g_Msgs.ListUsersFooter, AreaID, NumUsers));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
@ -275,14 +269,14 @@ end
|
|||||||
function HandleRemoveUser(a_Split, a_Player)
|
function HandleRemoveUser(a_Split, a_Player)
|
||||||
-- Command syntax: ProtRemUser AreaID UserName
|
-- Command syntax: ProtRemUser AreaID UserName
|
||||||
if (#a_Split ~= 3) then
|
if (#a_Split ~= 3) then
|
||||||
a_Player:SendMessage("Parameter mismatch. Expected <AreaID> <UserName>.");
|
a_Player:SendMessage(g_Msgs.ErrExpectedAreaIDUserName);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Parse the AreaID
|
-- Parse the AreaID
|
||||||
local AreaID = tonumber(a_Split[2]);
|
local AreaID = tonumber(a_Split[2]);
|
||||||
if (AreaID == nil) then
|
if (AreaID == nil) then
|
||||||
a_Player:SendMessage("Cannot parse <AreaID>.");
|
a_Player:SendMessage(g_Msgs.ErrParseAreaID);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -291,7 +285,7 @@ function HandleRemoveUser(a_Split, a_Player)
|
|||||||
g_Storage:RemoveUser(AreaID, UserName, a_Player:GetWorld():GetName());
|
g_Storage:RemoveUser(AreaID, UserName, a_Player:GetWorld():GetName());
|
||||||
|
|
||||||
-- Send confirmation
|
-- Send confirmation
|
||||||
a_Player:SendMessage("Removed " .. UserName .. " from area " .. AreaID);
|
a_Player:SendMessage(string.format(g_Msgs.RemovedUser, UserName, AreaID));
|
||||||
|
|
||||||
-- Reload all currently logged in players
|
-- Reload all currently logged in players
|
||||||
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
||||||
@ -306,13 +300,16 @@ end
|
|||||||
function HandleRemoveUserAll(a_Split, a_Player)
|
function HandleRemoveUserAll(a_Split, a_Player)
|
||||||
-- Command syntax: ProtRemUserAll UserName
|
-- Command syntax: ProtRemUserAll UserName
|
||||||
if (#a_Split ~= 2) then
|
if (#a_Split ~= 2) then
|
||||||
a_Player:SendMessage("Parameter mismatch. Expected <UserName>.");
|
a_Player:SendMessage(g_Msgs.ErrExpectedUserName);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Remove the user from the DB
|
-- Remove the user from the DB
|
||||||
g_Storage:RemoveUserAll(a_Split[2], a_Player:GetWorld():GetName());
|
g_Storage:RemoveUserAll(a_Split[2], a_Player:GetWorld():GetName());
|
||||||
|
|
||||||
|
-- Send confirmation
|
||||||
|
a_Player:SendMessage(string.format(g_Msgs.RemovedUserAll, UserName));
|
||||||
|
|
||||||
-- Reload all currently logged in players
|
-- Reload all currently logged in players
|
||||||
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
-- Individual commands, and their help strings. Don't touch the first symbol on each line!
|
-- Individual commands, and their help strings. Don't touch the first symbol on each line!
|
||||||
|
-- This needs to be implemented as a function, because it references other functions which might not yet be loaded while Lua is processing the globals
|
||||||
|
|
||||||
function CommandReg()
|
function CommandReg()
|
||||||
return {
|
return {
|
||||||
@ -26,3 +27,50 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--- Messages sent to players
|
||||||
|
g_Msgs =
|
||||||
|
{
|
||||||
|
AllUsersAlreadyAllowed = "All the specified users were already allowed.";
|
||||||
|
AreaAdded = "Area added, ID %s";
|
||||||
|
AreaAllowed = "Allowed";
|
||||||
|
AreaDeleted = "Area ID %s deleted";
|
||||||
|
AreaNotAllowed = "NOT allowed";
|
||||||
|
Coords1Set = "Coords1 set as {%d, %d}";
|
||||||
|
Coords2Set = "Coords2 set as {%d, %d}";
|
||||||
|
ErrCmdStateNilAddArea = "Cannot add area, internal plugin error (CmdState == nil)";
|
||||||
|
ErrCmdStateNilListAreas = "Cannot list areas, internal plugin error (CmdState == nil)";
|
||||||
|
ErrDBFailAddUsers = "Cannot add users, DB failure";
|
||||||
|
ErrExpectedAreaID = "Parameter mismatch. Expected <AreaID>.";
|
||||||
|
ErrExpectedAreaIDUserName = "Parameter mismatch. Expected <AreaID> <UserName>.";
|
||||||
|
ErrExpectedAreaIDUsernames = "Not enough parameters. Expected <AreaID> and a list of usernames.";
|
||||||
|
ErrExpectedCoordsUsernames = "Not enough parameters. Expected <x1> <z1> <x2> <z2> coords and a list of usernames.";
|
||||||
|
ErrExpectedListOfUsernames = "Not enough parameters. Expected a list of usernames.";
|
||||||
|
ErrExpectedUserName = "Parameter mismatch. Expected <UserName>.";
|
||||||
|
ErrListNotWanded = "Cannot list areas, no query point has been selected. Use a ProtWand lclk / rclk to select a point first";
|
||||||
|
ErrNoAreaWanded = "Cannot add area, no area has been selected. Use a ProtWand lclk / rclk to select area first";
|
||||||
|
ErrNoSpaceForWand = "Cannot give wand, no space in your inventory";
|
||||||
|
ErrNoSuchArea = "No such area: %s";
|
||||||
|
ErrParseAreaID = "Cannot parse <AreaID>.";
|
||||||
|
ErrParseCoords = "Cannot parse coords.";
|
||||||
|
ErrParseCoordsListAreas = "Cannot list areas, cannot parse coords in params";
|
||||||
|
ErrSyntaxErrorListAreas = "Cannot list areas, syntax error. Expected either no params or <x> <z>.";
|
||||||
|
ListAreasFooter = "Area list finished";
|
||||||
|
ListAreasHeader = "Listing protection areas intersecting block column {%d, %d}:";
|
||||||
|
ListAreasRow = " %s, %s, created by %s";
|
||||||
|
ListUsersFooter = "End of area %s user list, total %d users";
|
||||||
|
ListUsersHeader = "Area ID %s: {%d, %d} - {%d, %d}, created by %s; allowed users:";
|
||||||
|
ListUsersRow = " %s";
|
||||||
|
NotAllowedToBuild = "You are not allowed to build here!";
|
||||||
|
NotAllowedToDig = "You are not allowed to dig here!";
|
||||||
|
RemovedUser = "Removed %s from area %d";
|
||||||
|
RemovedUserAll = "Removed %s from all areas";
|
||||||
|
UsersAdded = "Users added: %s";
|
||||||
|
WandGiven = "Wand given";
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,14 +85,14 @@ function OnPlayerLeftClick(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace,
|
|||||||
|
|
||||||
-- Set the coords in the CommandState
|
-- Set the coords in the CommandState
|
||||||
GetCommandStateForPlayer(a_Player):SetCoords1(a_BlockX, a_BlockZ);
|
GetCommandStateForPlayer(a_Player):SetCoords1(a_BlockX, a_BlockZ);
|
||||||
a_Player:SendMessage("Coords1 set as {" .. a_BlockX .. ", " .. a_BlockZ .."}.");
|
a_Player:SendMessage(string.format(g_Msgs.Coords1Set, a_BlockX, a_BlockZ));
|
||||||
return true;
|
return true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
-- Check the player areas to see whether to disable this action
|
-- Check the player areas to see whether to disable this action
|
||||||
local Areas = g_PlayerAreas[a_Player:GetUniqueID()];
|
local Areas = g_PlayerAreas[a_Player:GetUniqueID()];
|
||||||
if not(Areas:CanInteractWithBlock(a_BlockX, a_BlockZ)) then
|
if not(Areas:CanInteractWithBlock(a_BlockX, a_BlockZ)) then
|
||||||
a_Player:SendMessage("You are not allowed to dig here!");
|
a_Player:SendMessage(g_Msgs.NotAllowedToDig);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -119,14 +119,14 @@ function OnPlayerRightClick(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace,
|
|||||||
if (cConfig:IsWand(a_Player:GetEquippedItem())) then
|
if (cConfig:IsWand(a_Player:GetEquippedItem())) then
|
||||||
-- Set the coords in the CommandState
|
-- Set the coords in the CommandState
|
||||||
GetCommandStateForPlayer(a_Player):SetCoords2(a_BlockX, a_BlockZ);
|
GetCommandStateForPlayer(a_Player):SetCoords2(a_BlockX, a_BlockZ);
|
||||||
a_Player:SendMessage("Coords2 set as {" .. a_BlockX .. ", " .. a_BlockZ .."}.");
|
a_Player:SendMessage(string.format(g_Msgs.Coords2Set, a_BlockX, a_BlockZ));
|
||||||
return true;
|
return true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
-- Check the player areas to see whether to disable this action
|
-- Check the player areas to see whether to disable this action
|
||||||
local Areas = g_PlayerAreas[a_Player:GetUniqueID()];
|
local Areas = g_PlayerAreas[a_Player:GetUniqueID()];
|
||||||
if not(Areas:CanInteractWithBlock(a_BlockX, a_BlockZ)) then
|
if not(Areas:CanInteractWithBlock(a_BlockX, a_BlockZ)) then
|
||||||
a_Player:SendMessage("You are not allowed to build here!");
|
a_Player:SendMessage(g_Msgs.NotAllowedToBuild);
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user