summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-07 16:13:43 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-07 16:13:43 +0200
commit0224a4f7fc17400dd100a2333c7bbf9c898426c4 (patch)
tree5b909dc5b57a6859334591e0c5295547d8e9061f /MCServer/Plugins
parentImproved function names for protocol packet sending; alpha-sorted the function lists (diff)
downloadcuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.gz
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.bz2
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.lz
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.xz
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.zst
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.zip
Diffstat (limited to 'MCServer/Plugins')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 12929541e..e2124c079 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -27,6 +27,8 @@ function Initialize(Plugin)
PluginManager:BindCommand("/wool", "debuggers", HandleWoolCmd, "Sets all your armor to blue wool");
PluginManager:BindCommand("/testwnd", "debuggers", HandleTestWndCmd, "Opens up a window using plugin API");
PluginManager:BindCommand("/gc", "debuggers", HandleGCCmd, "Activates the Lua garbage collector");
+ PluginManager:BindCommand("/fast", "debuggers", HandleFastCmd, "Switches between fast and normal movement speed");
+ PluginManager:BindCommand("/dash", "debuggers", HandleDashCmd, "Switches between fast and normal sprinting speed");
-- Enable the following line for BlockArea / Generator interface testing:
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
@@ -633,6 +635,40 @@ end
+function HandleFastCmd(a_Split, a_Player)
+ if (a_Player:GetNormalMaxSpeed() <= 0.11) then
+ -- The player has normal speed, set double speed:
+ a_Player:SetNormalMaxSpeed(0.2);
+ a_Player:SendMessage("You are now fast");
+ else
+ -- The player has fast speed, set normal speed:
+ a_Player:SetNormalMaxSpeed(0.1);
+ a_Player:SendMessage("Back to normal speed");
+ end
+ return true;
+end
+
+
+
+
+
+function HandleDashCmd(a_Split, a_Player)
+ if (a_Player:GetSprintingMaxSpeed() <= 0.14) then
+ -- The player has normal sprinting speed, set double Sprintingspeed:
+ a_Player:SetSprintingMaxSpeed(0.4);
+ a_Player:SendMessage("You can now sprint very fast");
+ else
+ -- The player has fast sprinting speed, set normal sprinting speed:
+ a_Player:SetSprintingMaxSpeed(0.13);
+ a_Player:SendMessage("Back to normal sprinting");
+ end
+ return true;
+end;
+
+
+
+
+
function OnChat(a_Player, a_Message)
return false, "blabla " .. a_Message;
end