1
0

Updated LimitWorld. (Patch by tonibm19)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1642 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
nielsbreu@gmail.com 2013-07-03 08:13:53 +00:00
parent f7b8a301f8
commit 504f6192f7

View File

@ -6,16 +6,16 @@ function OnPlayerMoving( Player )
local X = math.floor(Player:GetPosX() / 16) local X = math.floor(Player:GetPosX() / 16)
local Z = math.floor(Player:GetPosZ() / 16) local Z = math.floor(Player:GetPosZ() / 16)
if ( (SpawnX + LimitWorldWidth - 1) < X ) then if ( (SpawnX + LimitWorldWidth - 1) < X ) then
Player:TeleportTo(Player:GetPosX() - 1, Player:GetPosY(), Player:GetPosZ()) Player:TeleportToCoords(Player:GetPosX() - 1, Player:GetPosY(), Player:GetPosZ())
end end
if ( (SpawnX - LimitWorldWidth + 1) > X ) then if ( (SpawnX - LimitWorldWidth + 1) > X ) then
Player:TeleportTo(Player:GetPosX() + 1, Player:GetPosY(), Player:GetPosZ()) Player:TeleportToCoords(Player:GetPosX() + 1, Player:GetPosY(), Player:GetPosZ())
end end
if ( (SpawnZ + LimitWorldWidth - 1) < Z ) then if ( (SpawnZ + LimitWorldWidth - 1) < Z ) then
Player:TeleportTo(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() - 1) Player:TeleportToCoords(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() - 1)
end end
if ( (SpawnZ - LimitWorldWidth + 1) > Z ) then if ( (SpawnZ - LimitWorldWidth + 1) > Z ) then
Player:TeleportTo(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() + 1) Player:TeleportToCoords(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() + 1)
end end
end end
end end