addCommandHandler( "commands",
function(player)
local commandsList = {}
for _, subtable in pairs( getCommandHandlers() ) do
local commandName = subtable[1]
local theResource = subtable[2]
if not commandsList[theResource] then
commandsList[theResource] = {}
end
table.insert( commandsList[theResource], commandName )
end
for theResource, commands in pairs( commandsList ) do
local resourceName = getResourceInfo( theResource, "name" ) or getResourceName( theResource )
outputChatBox( "== "..resourceName.. " ==", player, 0, 255, 0 )
for _, command in pairs( commands ) do
outputChatBox( "/"..command, player, 255, 255, 255 )
end
end
end
)