diff options
author | madmaxoft <github@xoft.cz> | 2014-04-07 15:47:42 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-04-10 19:09:37 +0200 |
commit | 8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7 (patch) | |
tree | 73e06ca25fd337fab94a856d66e17a78f1d04a7a /MCServer/Plugins/InfoReg.lua | |
parent | Merge pull request #878 from mc-server/mobexp (diff) | |
download | cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.tar cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.tar.gz cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.tar.bz2 cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.tar.lz cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.tar.xz cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.tar.zst cuberite-8c7d0f53041af5b5e5b4e42902e6ac49abbd5bd7.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/InfoReg.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/MCServer/Plugins/InfoReg.lua b/MCServer/Plugins/InfoReg.lua index 27e63aa5b..da5a9972c 100644 --- a/MCServer/Plugins/InfoReg.lua +++ b/MCServer/Plugins/InfoReg.lua @@ -16,22 +16,22 @@ local function ListSubcommands(a_Player, a_Subcommands, a_CmdString) end -- Enum all the subcommands: - local Verbs = {}; + local Verbs = {} for cmd, info in pairs(a_Subcommands) do - if (a_Player:HasPermission(info.Permission or "")) then - table.insert(Verbs, " " .. a_CmdString .. " " .. cmd); + if ((a_Player == nil) or (a_Player:HasPermission(info.Permission or ""))) then + table.insert(Verbs, a_CmdString .. " " .. cmd) end end - table.sort(Verbs); + table.sort(Verbs) -- Send the list: if (a_Player == nil) then for idx, verb in ipairs(Verbs) do - LOGINFO(verb); + LOGINFO(" " .. verb) end else for idx, verb in ipairs(Verbs) do - a_Player:SendMessage(verb); + a_Player:SendMessage(cCompositeChat(" ", mtInfo):AddSuggestCommandPart(verb, verb)) end end end |