diff --git a/ctf_flag/hud.lua b/ctf_flag/hud.lua index 1b9d360..776fe46 100644 --- a/ctf_flag/hud.lua +++ b/ctf_flag/hud.lua @@ -28,21 +28,26 @@ end) ctf.hud.register_part(function(player, name, tplayer) -- Check all flags - local alert = "Punch the enemy flag! Protect your flag!" + local alert = nil local color = "0xFFFFFF" - local claimed = ctf_flag.collect_claimed() - for _, flag in pairs(claimed) do - if flag.claimed.player == name then - alert = "You've got the flag! Run back and punch your flag!" - color = "0xFF0000" - break - elseif flag.team == tplayer.team then - alert = "Kill " .. flag.claimed.player .. ", they have your flag!" - color = "0xFF0000" - break - else - alert = "Protect " .. flag.claimed.player .. ", he's got the enemy flag!" - color = "0xFF0000" + if ctf.setting("flag.alerts") then + if ctf.setting("flag.alerts.neutral_alert") then + alert = "Punch the enemy flag! Protect your flag!" + end + local claimed = ctf_flag.collect_claimed() + for _, flag in pairs(claimed) do + if flag.claimed.player == name then + alert = "You've got the flag! Run back and punch your flag!" + color = "0xFF0000" + break + elseif flag.team == tplayer.team then + alert = "Kill " .. flag.claimed.player .. ", they have your flag!" + color = "0xFF0000" + break + else + alert = "Protect " .. flag.claimed.player .. ", he's got the enemy flag!" + color = "0xFF0000" + end end end diff --git a/ctf_flag/init.lua b/ctf_flag/init.lua index 5244448..ea5243f 100644 --- a/ctf_flag/init.lua +++ b/ctf_flag/init.lua @@ -10,6 +10,8 @@ ctf.register_on_init(function() ctf._set("flag.capture_mode", "take") ctf._set("flag.drop_time", 7*60) ctf._set("flag.drop_warn_time", 60) + ctf._set("flag.alerts", true) + ctf._set("flag.alerts.neutral_alert", true) ctf._set("gui.team.teleport_to_flag", true) ctf._set("gui.team.teleport_to_spawn", false) end)