Better help hints
This commit is contained in:
parent
cd43aedca5
commit
f8d56da0f0
@ -41,13 +41,13 @@ ctf.hud.register_part(function(player, name, tplayer)
|
|||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 1, y = 0},
|
position = {x = 1, y = 0},
|
||||||
scale = {x = 100, y = 100},
|
scale = {x = 100, y = 100},
|
||||||
text = tplayer.team,
|
text = "Team " .. tplayer.team,
|
||||||
number = color,
|
number = color,
|
||||||
offset = {x = -20, y = 20},
|
offset = {x = -20, y = 20},
|
||||||
alignment = {x = -1, y = 0}
|
alignment = {x = -1, y = 0}
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
ctf.hud:change(player, "ctf:hud_team", "text", tplayer.team)
|
ctf.hud:change(player, "ctf:hud_team", "text", "Team " .. tplayer.team)
|
||||||
ctf.hud:change(player, "ctf:hud_team", "number", color)
|
ctf.hud:change(player, "ctf:hud_team", "number", color)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
@ -80,25 +80,35 @@ ctf.hud.register_part(function(player, name, tplayer)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
ctf.hud.register_part(function(player, name, tplayer)
|
ctf.hud.register_part(function(player, name, tplayer)
|
||||||
local alert = nil
|
-- Check all flags
|
||||||
local team = ctf.team(tplayer.team)
|
local alert = "Punch the enemy flag! Protect your flag!"
|
||||||
for _, flag in pairs(team.flags) do
|
local color = "0xFFFFFF"
|
||||||
if flag.claimed then
|
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"
|
||||||
|
elseif flag.team == tplayer.team then
|
||||||
alert = "Kill " .. flag.claimed.player .. ", they have your flag!"
|
alert = "Kill " .. flag.claimed.player .. ", they have your flag!"
|
||||||
break
|
color = "0xFF0000"
|
||||||
|
else
|
||||||
|
alert = "Protect " .. flag.claimed.player .. ", he's got the enemy flag!"
|
||||||
|
color = "0xFF0000"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Display alert
|
||||||
if alert then
|
if alert then
|
||||||
if ctf.hud:exists(player, "ctf:hud_team_alert") then
|
if ctf.hud:exists(player, "ctf:hud_team_alert") then
|
||||||
ctf.hud:change(player, "ctf:hud_team_alert", "text", alert)
|
ctf.hud:change(player, "ctf:hud_team_alert", "text", alert)
|
||||||
|
ctf.hud:change(player, "ctf:hud_team_alert", "number", color)
|
||||||
else
|
else
|
||||||
ctf.hud:add(player, "ctf:hud_team_alert", {
|
ctf.hud:add(player, "ctf:hud_team_alert", {
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 1, y = 0},
|
position = {x = 1, y = 0},
|
||||||
scale = {x = 100, y = 100},
|
scale = {x = 100, y = 100},
|
||||||
text = alert,
|
text = alert,
|
||||||
number = "0xFF0000",
|
number = color,
|
||||||
offset = {x = -10, y = 50},
|
offset = {x = -10, y = 50},
|
||||||
alignment = {x = -1, y = 0}
|
alignment = {x = -1, y = 0}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user