Jump to content

Listing commands


robhol

Recommended Posts

I think it could be useful having a tool that lists commands for you - something like

table getCommandHandlers( [ string/resource res ] )

(res is the resource from which the command handler was registered)

Since I'm fairly sure those are already collected at one place, this looks like another 5-min implementation, and it'd help for ACL masking, documentation and help files, etc. since overlooking one command in a large resource is easy and, especially in the case of ACL coverage, the results may be unpleasant..

Link to comment

I think this would be a good idea also a new event onPlayerCommand Which should be called every time a player does a command

EG

addEventHandler("onPlayerCommand",getRootElement(),
function (Command)
local Players = getElementsByType("player")
for k,p in ipairs(Players) do
if isObjectInACLGroup ( "user." .. getPlayerName(p), aclGetGroup ( "Admin" ) ) then
outputChatBox(getPlayerName(source).." typed: ".. Command,p)
end
end
end
)

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...