Skip to content

Commit

Permalink
Reduce donation timer from 5 to 2.5 minutes (#1296)
Browse files Browse the repository at this point in the history
Fixed the command description and changed the time to 2 minutes and 30 seconds instead of 5 minutes.

[Suggestion Link](https://discord.com/channels/447819017391046687/448136308108296213/1238583896258511041)
(it got more then 9 more up votes the downvotes)

Co-authored-by: LoneWolfHT <[email protected]>
  • Loading branch information
pl608 and LoneWolfHT authored Jun 4, 2024
1 parent 6660f57 commit 6c94c17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mods/ctf/ctf_modebase/ranking_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ctf_api.register_on_match_end(function()
end)

minetest.register_chatcommand("donate", {
description = "Donate your match score to your teammate\nCan be used only once in 10 minutes",
description = "Donate your match score to your teammate\nCan be used only once in 2.5 minutes",
params = "<playername> <score> [message]",
func = function(name, param)
local current_mode = ctf_modebase:get_current_mode()
Expand Down Expand Up @@ -153,10 +153,10 @@ minetest.register_chatcommand("donate", {
return false, "You can donate only half of your match score!"
end

if donate_timer[name] and donate_timer[name] + 300 > os.time() then
local time_diff = donate_timer[name] + 300 - os.time()
if donate_timer[name] and donate_timer[name] + 150 > os.time() then
local time_diff = donate_timer[name] + 150 - os.time()
return false, string.format(
"You can donate only once in 5 minutes! You can donate again in %dm %ds.",
"You can donate only once in 2.5 minutes! You can donate again in %dm %ds.",
math.floor(time_diff / 60),
time_diff % 60)
end
Expand Down

0 comments on commit 6c94c17

Please sign in to comment.