Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time left to text shown when donation timer is not over #1240

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mods/ctf/ctf_modebase/ranking_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading