summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/MagicCarpet/plugin.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-08 22:52:12 +0200
committermadmaxoft <github@xoft.cz>2013-10-08 22:52:12 +0200
commit06c8217b65a36dd42fed3b2d4317a056f03d2f1a (patch)
tree28e8a4204a97101c3faca697a183c174bdd3de24 /MCServer/Plugins/MagicCarpet/plugin.lua
parentFixed WebAdmin template after moving the memory stats functions to cRoot. (diff)
parentSome additional changes (diff)
downloadcuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.tar
cuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.tar.gz
cuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.tar.bz2
cuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.tar.lz
cuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.tar.xz
cuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.tar.zst
cuberite-06c8217b65a36dd42fed3b2d4317a056f03d2f1a.zip
Diffstat (limited to 'MCServer/Plugins/MagicCarpet/plugin.lua')
-rw-r--r--MCServer/Plugins/MagicCarpet/plugin.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/MCServer/Plugins/MagicCarpet/plugin.lua b/MCServer/Plugins/MagicCarpet/plugin.lua
index 27dcdf45d..81eb02a9c 100644
--- a/MCServer/Plugins/MagicCarpet/plugin.lua
+++ b/MCServer/Plugins/MagicCarpet/plugin.lua
@@ -1,18 +1,16 @@
-local PLUGIN = {}
local Carpets = {}
function Initialize( Plugin )
- PLUGIN = Plugin
-
Plugin:SetName( "MagicCarpet" )
- Plugin:SetVersion( 1 )
+ Plugin:SetVersion( 2 )
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving)
cPluginManager.AddHook(cPluginManager.HOOK_DISCONNECT, OnDisconnect)
+ local PluginManager = cPluginManager:Get()
PluginManager:BindCommand("/mc", "magiccarpet", HandleCarpetCommand, " - Spawns a magical carpet");
- LOG( "Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion() )
+ LOG( "Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion() )
return true
end
@@ -33,14 +31,15 @@ end
function HandleCarpetCommand( Split, Player )
Carpet = Carpets[ Player ]
+
if( Carpet == nil ) then
Carpets[ Player ] = cCarpet:new()
- Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "You're on a magic carpet!" )
- Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Look straight down to descend. Jump to ascend!" )
+ SendMessageSuccess(Player, "You're on a magic carpet!")
+ SendMessage(Player, "Look straight down to descend. Jump to ascend.")
else
Carpet:remove()
Carpets[ Player ] = nil
- Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "The carpet vanished!" )
+ SendMessageSuccess(Player, "The carpet vanished!")
end
return true