Setting for flag alerts

This commit is contained in:
rubenwardy 2016-03-31 16:59:22 +01:00
parent f7890cdf66
commit 92d813b090
2 changed files with 21 additions and 14 deletions

View File

@ -28,8 +28,12 @@ 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"
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
@ -45,6 +49,7 @@ ctf.hud.register_part(function(player, name, tplayer)
color = "0xFF0000"
end
end
end
-- Display alert
if alert then

View File

@ -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)