Skip to content

Commit

Permalink
Merge branch 'master' into show-map
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT authored Jun 4, 2024
2 parents 1ee1ce1 + 6c94c17 commit 8dad908
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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
9 changes: 8 additions & 1 deletion mods/other/email/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,14 @@ minetest.register_chatcommand("mail", {
func = function(name, param)
local to, msg = string.match(param, "^([%a%d_-]+) (.+)")
if to and msg then
return email.send_mail(name, to, msg)
if minetest.check_player_privs(name, "shout") then
return email.send_mail(name, to, msg)
elseif not minetest.check_player_privs(name, "shout") and
minetest.check_player_privs(to, "basic_privs") then
return email.send_mail(name, to, msg)
else
return false, S("-!- You don't have the permission to speak, so you can only mail staff members.")
end
else
return false, S("Usage: mail <playername> <some message>")
end
Expand Down

0 comments on commit 8dad908

Please sign in to comment.