summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/teleport.lua
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-07-27 17:15:29 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-07-27 17:15:29 +0200
commitaa6445042163366b225cf65f6ce7186377f2faf6 (patch)
tree1593ac9b849f3416aafa70c440694200c62e6b2c /MCServer/Plugins/Core/teleport.lua
parentMerge pull request #3 from mc-server/git-transition (diff)
downloadcuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar
cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.gz
cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.bz2
cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.lz
cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.xz
cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.zst
cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.zip
Diffstat (limited to 'MCServer/Plugins/Core/teleport.lua')
-rw-r--r--MCServer/Plugins/Core/teleport.lua46
1 files changed, 0 insertions, 46 deletions
diff --git a/MCServer/Plugins/Core/teleport.lua b/MCServer/Plugins/Core/teleport.lua
deleted file mode 100644
index ad9e7be69..000000000
--- a/MCServer/Plugins/Core/teleport.lua
+++ /dev/null
@@ -1,46 +0,0 @@
-function HandleTPCommand(a_Split, a_Player)
- if ((#a_Split == 2) or (#a_Split == 3)) then
- -- Teleport to player specified in a_Split[2], tell them unless a_Split[3] equals "-h":
- TeleportToPlayer(a_Player, a_Split[2], (a_Split[3] ~= "-h"));
- return true;
- elseif (#a_Split == 4) then
- -- Teleport to XYZ coords specified in a_Split[2, 3, 4]:
- SetBackCoordinates(a_Player);
- a_Player:TeleportToCoords(a_Split[2], a_Split[3], a_Split[4]);
- a_Player:SendMessage(cChatColor.Green .. "You teleported to {" .. a_Split[2] .. ", " .. a_Split[3] .. ", " .. a_Split[4] .. "}");
- return true;
- else
- Player:SendMessage( cChatColor.Green .. "Usage: /tp [PlayerName] (-h)" )
- return true
- end
-end
-
-
-
-
-
--- Teleports a_SrcPlayer to a player named a_DstPlayerName; if a_TellDst is true, will send a notice to the destination player
-function TeleportToPlayer(a_SrcPlayer, a_DstPlayerName, a_TellDst)
- local teleport = function(OtherPlayer)
- if (OtherPlayer == a_SrcPlayer) then
- -- Asked to teleport to self?
- a_SrcPlayer:SendMessage(cChatColor.Green .. "Already there :)");
- else
- SetBackCoordinates(a_SrcPlayer);
- a_SrcPlayer:TeleportToEntity(OtherPlayer);
- a_SrcPlayer:SendMessage(cChatColor.Green .. "You teleported to " .. OtherPlayer:GetName() .. "!");
- if (a_TellDst) then
- OtherPlayer:SendMessage(cChatColor.Green .. Player:GetName().." teleported to you!");
- end
- end
- end
-
- local World = Player:GetWorld();
- if (not(World:DoWithPlayer(s_DstPlayerName, teleport))) then
- a_SrcPlayer:SendMessage(cChatColor.Green .. "Can't find player " .. a_DstPlayerName);
- end
-end
-
-
-
-