1
0

Added a /toggledownfall command that toggles the weather.

changed back the stop.lua

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1312 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
nielsbreu@gmail.com 2013-03-24 18:41:19 +00:00
parent 9eff51d831
commit aae46468c7
3 changed files with 12 additions and 3 deletions

View File

@ -32,6 +32,7 @@ function Initialize(Plugin)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING) PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING) PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING)
PluginManager:BindCommand("/toggledownfall", "core.toggledownfall", HandleToggleDownfallCommand, " - Toggles the weather");
PluginManager:BindCommand("/back", "core.back", HandleBackCommand, " - Return to your last position"); PluginManager:BindCommand("/back", "core.back", HandleBackCommand, " - Return to your last position");
PluginManager:BindCommand("/save-all", "core.save-all", HandleSaveAllCommand, " - Saves all your worlds"); PluginManager:BindCommand("/save-all", "core.save-all", HandleSaveAllCommand, " - Saves all your worlds");
PluginManager:BindCommand("/help", "core.help", HandleHelpCommand, " [Page] - Show available commands"); PluginManager:BindCommand("/help", "core.help", HandleHelpCommand, " [Page] - Show available commands");

View File

@ -1,8 +1,6 @@
function HandleStopCommand( Split, Player ) function HandleStopCommand( Split, Player )
Server = cRoot:Get():GetServer() Server = cRoot:Get():GetServer()
PluginManager = cRoot:Get():GetPluginManager()
Server:SendMessage( cChatColor.Green .. "Stopping the server..." ) Server:SendMessage( cChatColor.Green .. "Stopping the server..." )
PluginManager:ExecuteConsoleCommand("stop") cRoot:Get():ServerCommand("stop")
--cRoot:Get():ServerCommand("stop")
return true return true
end end

View File

@ -0,0 +1,10 @@
function HandleToggleDownfallCommand( Split, Player )
World = Player:GetWorld()
if World:GetWeather() == 0 then
World:SetWeather(1)
else
World:SetWeather(0)
end
Player:SendMessage( cChatColor.Green .. "Weather toggled")
return true
end