diff options
author | nielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-28 20:43:29 +0200 |
---|---|---|
committer | nielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-28 20:43:29 +0200 |
commit | cff6ff2223247997d357fc9421a2cfa3a5a54598 (patch) | |
tree | 755347c25db8c6db4a1fe95c34d0863425482bd9 /MCServer/Plugins/Core | |
parent | Added /listworlds command and fixed bug in /listgroups where you have an extra comma at the end. (diff) | |
download | cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.tar cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.tar.gz cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.tar.bz2 cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.tar.lz cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.tar.xz cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.tar.zst cuberite-cff6ff2223247997d357fc9421a2cfa3a5a54598.zip |
Diffstat (limited to 'MCServer/Plugins/Core')
-rw-r--r-- | MCServer/Plugins/Core/functions.lua | 5 | ||||
-rw-r--r-- | MCServer/Plugins/Core/onkilling.lua | 1 | ||||
-rw-r--r-- | MCServer/Plugins/Core/spawn.lua | 4 | ||||
-rw-r--r-- | MCServer/Plugins/Core/teleport.lua | 4 | ||||
-rw-r--r-- | MCServer/Plugins/Core/top.lua | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/MCServer/Plugins/Core/functions.lua b/MCServer/Plugins/Core/functions.lua new file mode 100644 index 000000000..6d82d2253 --- /dev/null +++ b/MCServer/Plugins/Core/functions.lua @@ -0,0 +1,5 @@ +function SetBackCoordinates( Player )
+ X[Player:GetName()] = Player:GetPosX()
+ Y[Player:GetName()] = Player:GetPosY()
+ Z[Player:GetName()] = Player:GetPosZ()
+end
\ No newline at end of file diff --git a/MCServer/Plugins/Core/onkilling.lua b/MCServer/Plugins/Core/onkilling.lua index 80eb348ad..e74f36065 100644 --- a/MCServer/Plugins/Core/onkilling.lua +++ b/MCServer/Plugins/Core/onkilling.lua @@ -1,5 +1,6 @@ function OnKilling(Victim, Killer)
if Victim:IsPlayer() then
+ SetBackCoordinates( Victim )
Server = cRoot:Get():GetServer()
if Killer == nil then
if Victim:IsOnFire() then
diff --git a/MCServer/Plugins/Core/spawn.lua b/MCServer/Plugins/Core/spawn.lua index 2938318b2..284a80685 100644 --- a/MCServer/Plugins/Core/spawn.lua +++ b/MCServer/Plugins/Core/spawn.lua @@ -1,8 +1,6 @@ function HandleSpawnCommand( Split, Player )
World = Player:GetWorld()
- X[Player:GetName()] = Player:GetPosX()
- Y[Player:GetName()] = Player:GetPosY()
- Z[Player:GetName()] = Player:GetPosZ()
+ SetBackCoordinates( Player )
Player:TeleportTo( World:GetSpawnX(), World:GetSpawnY(), World:GetSpawnZ() )
LOGINFO( Player:GetName() .. " returned to spawn." )
return true
diff --git a/MCServer/Plugins/Core/teleport.lua b/MCServer/Plugins/Core/teleport.lua index b991b6185..5a004591b 100644 --- a/MCServer/Plugins/Core/teleport.lua +++ b/MCServer/Plugins/Core/teleport.lua @@ -8,9 +8,7 @@ function HandleTPCommand( Split, Player ) if( OtherPlayer == Player ) then
Player:SendMessage( cChatColor.Green .. "Already there :)" )
else
- X[Player:GetName()] = Player:GetPosX()
- Y[Player:GetName()] = Player:GetPosY()
- Z[Player:GetName()] = Player:GetPosZ()
+ SetBackCoordinates( Player )
Player:TeleportToEntity( OtherPlayer )
Player:SendMessage( cChatColor.Green .. "You teleported to "..OtherPlayer:GetName().."!" )
if Split[3] ~= "-h" then
diff --git a/MCServer/Plugins/Core/top.lua b/MCServer/Plugins/Core/top.lua index 91f9aa297..64b53eff6 100644 --- a/MCServer/Plugins/Core/top.lua +++ b/MCServer/Plugins/Core/top.lua @@ -3,9 +3,7 @@ function HandleTopCommand( Split, Player ) local PlayerPos = Player:GetPosition()
local Height = World:GetHeight( math.floor(PlayerPos.x), math.floor(PlayerPos.z) )
- X[Player:GetName()] = Player:GetPosX()
- Y[Player:GetName()] = Player:GetPosY()
- Z[Player:GetName()] = Player:GetPosZ()
+ SetBackCoordinates( Player )
Player:TeleportTo( PlayerPos.x, Height+1, PlayerPos.z )
Player:SendMessage("Teleported to the top block")
|