1
0

Core: fixed /help and /pluginlist

git-svn-id: http://mc-server.googlecode.com/svn/trunk@967 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth 2012-10-15 22:55:45 +00:00
parent f9dab57d8b
commit 6d121a4914
2 changed files with 26 additions and 22 deletions

View File

@ -12,7 +12,8 @@ function HandleHelpCommand( Split, Player )
local Pages = {} local Pages = {}
local PluginList = PluginManager:GetAllPlugins() local PluginList = PluginManager:GetAllPlugins()
for i, Plugin in ipairs( PluginList ) do for k, Plugin in pairs(PluginList) do
if( Plugin ) then
local Commands = Plugin:GetCommands() local Commands = Plugin:GetCommands()
for i, v in ipairs( Commands ) do for i, v in ipairs( Commands ) do
if( Player:HasPermission( v.Permission ) ) then if( Player:HasPermission( v.Permission ) ) then
@ -41,6 +42,7 @@ function HandleHelpCommand( Split, Player )
end end
end end
end end
end
Player:SendMessage( cChatColor.Purple .. "- All commands - " .. cChatColor.Gold .. "[Page " .. (CurrentPage) .."/"..#Pages.."]" ) Player:SendMessage( cChatColor.Purple .. "- All commands - " .. cChatColor.Gold .. "[Page " .. (CurrentPage) .."/"..#Pages.."]" )

View File

@ -3,9 +3,11 @@ function HandlePluginListCommand( Split, Player )
local PluginList = PluginManager:GetAllPlugins() local PluginList = PluginManager:GetAllPlugins()
local PluginTable = {} local PluginTable = {}
for i, Plugin in ipairs( PluginList ) do for k, Plugin in pairs( PluginList ) do
if ( Plugin ) then
table.insert(PluginTable, Plugin:GetName() ) table.insert(PluginTable, Plugin:GetName() )
end end
end
Player:SendMessage( cChatColor.Green .. "Loaded plugins: (" .. #PluginTable .. ")" ) Player:SendMessage( cChatColor.Green .. "Loaded plugins: (" .. #PluginTable .. ")" )
Player:SendMessage( cChatColor.Gold .. table.concat(PluginTable, cChatColor.Gold.." ") ) Player:SendMessage( cChatColor.Gold .. table.concat(PluginTable, cChatColor.Gold.." ") )