1
0

GameMode Switch added to Core Functions (/gm 0 | /gm 1) needs permission core.changegm

git-svn-id: http://mc-server.googlecode.com/svn/trunk@123 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
lapayo94@gmail.com 2011-12-26 16:43:45 +00:00
parent 2a1d75ab09
commit f65115ef9f

View File

@ -45,6 +45,7 @@ function CorePlugin:Initialize()
self:AddCommand("/ban", " - [Player] - Ban a player", "core.ban") self:AddCommand("/ban", " - [Player] - Ban a player", "core.ban")
self:AddCommand("/unban", " - [Player] - Unban a player", "core.unban") self:AddCommand("/unban", " - [Player] - Unban a player", "core.unban")
self:AddCommand("/top", " - Teleport yourself to the top most block", "core.top") self:AddCommand("/top", " - Teleport yourself to the top most block", "core.top")
self:AddCommand("/gm", " - [Gamemode (0|1)] - Change your gamemode", "core.changegm")
self:BindCommand( "/help", "core.help", HandleHelpCommand ) self:BindCommand( "/help", "core.help", HandleHelpCommand )
self:BindCommand( "/pluginlist","core.pluginlist", HandlePluginListCommand ) self:BindCommand( "/pluginlist","core.pluginlist", HandlePluginListCommand )
@ -63,6 +64,7 @@ function CorePlugin:Initialize()
self:BindCommand( "/ban", "core.ban", HandleBanCommand ) self:BindCommand( "/ban", "core.ban", HandleBanCommand )
self:BindCommand( "/unban", "core.unban", HandleUnbanCommand ) self:BindCommand( "/unban", "core.unban", HandleUnbanCommand )
self:BindCommand( "/top", "core.top", HandleTopCommand ) self:BindCommand( "/top", "core.top", HandleTopCommand )
self:BindCommand( "/gm", "core.changegm", HandleChangeGMCommand )
local IniFile = cIniFile("settings.ini") local IniFile = cIniFile("settings.ini")
if ( IniFile:ReadFile() == true ) then if ( IniFile:ReadFile() == true ) then
@ -408,6 +410,17 @@ function HandleTPCommand( Split, Player )
return true return true
end end
function HandleChangeGMCommand( Split, Player )
if( #Split ~= 2 ) then
Player:SendMessage( cChatColor.Green .. "Usage: /gm [GameMode (0|1)]" )
return true
end
Player:SetGameMode(Split[2])
return true
end
function CorePlugin:OnPlayerJoin( Player ) function CorePlugin:OnPlayerJoin( Player )
ShowMOTDTo( Player ) ShowMOTDTo( Player )
return false return false