Add /s chat-command alias for /summary

This commit is contained in:
ANAND 2019-12-23 13:42:40 +05:30
parent 4a1764983e
commit ffdb5dd799

View file

@ -51,12 +51,7 @@ local function return_as_chat_result(to, target)
return result return result
end end
------------------- local function summary_func(name)
-- Chat-commands --
-------------------
minetest.register_chatcommand("summary", {
func = function(name)
local fs = ctf_stats.get_formspec_match_summary(ctf_stats.current, local fs = ctf_stats.get_formspec_match_summary(ctf_stats.current,
ctf_stats.winner_team, ctf_stats.winner_player, os.time() - ctf_stats.start) ctf_stats.winner_team, ctf_stats.winner_player, os.time() - ctf_stats.start)
@ -65,6 +60,19 @@ minetest.register_chatcommand("summary", {
minetest.log("action", name .. " requested match summary formspec") minetest.log("action", name .. " requested match summary formspec")
minetest.show_formspec(name, "ctf_stats:match_summary", fs) minetest.show_formspec(name, "ctf_stats:match_summary", fs)
end end
-------------------
-- Chat-commands --
-------------------
minetest.register_chatcommand("summary", {
description = "Display the match summary",
func = summary_func
})
minetest.register_chatcommand("s", {
description = "Display the match summary",
func = summary_func
}) })
minetest.register_chatcommand("r", { minetest.register_chatcommand("r", {