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:
parent
2a1d75ab09
commit
f65115ef9f
@ -45,6 +45,7 @@ function CorePlugin:Initialize()
|
||||
self:AddCommand("/ban", " - [Player] - Ban a player", "core.ban")
|
||||
self:AddCommand("/unban", " - [Player] - Unban a player", "core.unban")
|
||||
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( "/pluginlist","core.pluginlist", HandlePluginListCommand )
|
||||
@ -63,6 +64,7 @@ function CorePlugin:Initialize()
|
||||
self:BindCommand( "/ban", "core.ban", HandleBanCommand )
|
||||
self:BindCommand( "/unban", "core.unban", HandleUnbanCommand )
|
||||
self:BindCommand( "/top", "core.top", HandleTopCommand )
|
||||
self:BindCommand( "/gm", "core.changegm", HandleChangeGMCommand )
|
||||
|
||||
local IniFile = cIniFile("settings.ini")
|
||||
if ( IniFile:ReadFile() == true ) then
|
||||
@ -408,6 +410,17 @@ function HandleTPCommand( Split, Player )
|
||||
return true
|
||||
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 )
|
||||
ShowMOTDTo( Player )
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user