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:
parent
f9dab57d8b
commit
6d121a4914
@ -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.."]" )
|
||||||
|
|
||||||
|
@ -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.." ") )
|
||||||
|
Loading…
Reference in New Issue
Block a user