diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 17:43:45 +0100 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 17:43:45 +0100 |
commit | f65115ef9f200aa882d517c3ade53919a0e57114 (patch) | |
tree | 6af7b5fe517aaedb028a2d67562db216a62ab30a | |
parent | Fixed the little check for max players. If somehow a player was able to connect and the number of players would exceed the max players, everybody is allowed in and the server will never be 'full'. It's fixed now (diff) | |
download | cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.tar cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.tar.gz cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.tar.bz2 cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.tar.lz cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.tar.xz cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.tar.zst cuberite-f65115ef9f200aa882d517c3ade53919a0e57114.zip |
Diffstat (limited to '')
-rw-r--r-- | Plugins/Core.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Plugins/Core.lua b/Plugins/Core.lua index 5b98fcbaa..5090dcf95 100644 --- a/Plugins/Core.lua +++ b/Plugins/Core.lua @@ -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
|