Accept: cmds with formatting

This commit is contained in:
Coder12a 2020-01-02 18:57:52 -06:00
parent d64425ade8
commit 8e2a92b792
1 changed files with 11 additions and 2 deletions

View File

@ -214,10 +214,19 @@ function factions_chat.cmdhandler(playername, parameter)
end
return
end
--local cmd = factions.commands[params[1]]
local cmd = factions.commands[parameter]
if not cmd then
cmd = factions.commands[params[1]]
local cmd_text = ""
for i = 1, #params, 1 do
if cmd_text == "" then
cmd_text = params[i]
else
cmd_text = cmd_text .. " " .. params[i]
end
if factions.commands[cmd_text] then
cmd = factions.commands[cmd_text]
end
end
if not cmd then
minetest.chat_send_player(playername, "Unknown command.")
return false