From 5614e341df9c4af93be1a81e479350c0fa42087e Mon Sep 17 00:00:00 2001 From: s20 <129506166+src4026@users.noreply.github.com> Date: Fri, 3 Nov 2023 22:46:41 +0530 Subject: [PATCH] Add time left to text shown when donation timer is not over (#1240) * Add time left to text shown when timer is not over * Update ranking_commands.lua --- mods/ctf/ctf_modebase/ranking_commands.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ctf/ctf_modebase/ranking_commands.lua b/mods/ctf/ctf_modebase/ranking_commands.lua index 8b95849d89..71252b644a 100644 --- a/mods/ctf/ctf_modebase/ranking_commands.lua +++ b/mods/ctf/ctf_modebase/ranking_commands.lua @@ -152,7 +152,11 @@ minetest.register_chatcommand("donate", { end if donate_timer[name] and donate_timer[name] + 300 > os.time() then - return false, "You can donate only once in 5 minutes!" + local time_diff = donate_timer[name] + 300 - os.time() + return false, string.format( + "You can donate only once in 5 minutes! You can donate again in %dm %ds.", + math.floor(time_diff / 60), + time_diff % 60) end current_mode.recent_rankings.add(pname, {score=score}, true)