1
0

Reduced the amount of tables.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1644 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
nielsbreu@gmail.com 2013-07-05 11:13:21 +00:00
parent e27a5db409
commit cc4a1cad39
3 changed files with 4 additions and 8 deletions

View File

@ -1,8 +1,8 @@
function HandleBackCommand( Split, Player )
if (X[Player:GetName()] == nil) or (Y[Player:GetName()] == nil) or (Z[Player:GetName()] == nil) then
if BackCoords[Player:GetName()] == nil then
Player:SendMessage(cChatColor.Green .. "There is no last position known")
else
Player:TeleportToCoords(X[Player:GetName()], Y[Player:GetName()], Z[Player:GetName()])
Player:TeleportToCoords(BackCoords[Player:GetName()].x, BackCoords[Player:GetName()].y, BackCoords[Player:GetName()].z)
Player:SendMessage(cChatColor.Green .. "You teleported back to your last known position")
end
return true

View File

@ -1,5 +1,3 @@
function SetBackCoordinates( Player )
X[Player:GetName()] = Player:GetPosX()
Y[Player:GetName()] = Player:GetPosY()
Z[Player:GetName()] = Player:GetPosZ()
BackCoords[Player:GetName()] = Vector3i( Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() )
end

View File

@ -7,9 +7,7 @@ SHOW_PLUGIN_NAMES = true -- If true, plugin name will be shown before commands
PLUGIN = {} -- Reference to own plugin object
BannedPlayersIni = {}
WhiteListIni = {}
X = {}
Y = {}
Z = {}
BackCoords = {}
LimitWorldsCuboid = {}