Accept: cmds with formatting
This commit is contained in:
parent
d64425ade8
commit
8e2a92b792
@ -214,10 +214,19 @@ function factions_chat.cmdhandler(playername, parameter)
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
--local cmd = factions.commands[params[1]]
|
|
||||||
local cmd = factions.commands[parameter]
|
local cmd = factions.commands[parameter]
|
||||||
if not cmd then
|
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
|
if not cmd then
|
||||||
minetest.chat_send_player(playername, "Unknown command.")
|
minetest.chat_send_player(playername, "Unknown command.")
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user