Display kill score as a HUD element (#182)
This commit is contained in:
parent
d111d8673a
commit
77cdecc15e
2 changed files with 83 additions and 1 deletions
|
@ -44,6 +44,9 @@ local function bounty_player(target)
|
|||
end
|
||||
bounty_score = math.floor(bounty_score)
|
||||
|
||||
ctf_stats.current_bounty["name"] = bountied_player
|
||||
ctf_stats.current_bounty["score"] = bounty_score
|
||||
|
||||
minetest.after(0.1, announce_all)
|
||||
end
|
||||
|
||||
|
@ -70,6 +73,7 @@ minetest.after(math.random(500, 1000), bounty_find_new_target)
|
|||
minetest.register_on_leaveplayer(function(player)
|
||||
if bountied_player == player:get_player_name() then
|
||||
bountied_player = nil
|
||||
ctf_stats.current_bounty = {}
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -92,6 +96,7 @@ ctf.register_on_killedplayer(function(victim, killer)
|
|||
ctf.needs_save = true
|
||||
end
|
||||
bountied_player = nil
|
||||
ctf_stats.current_bounty = {}
|
||||
|
||||
local msg = killer .. " has killed " .. victim .. " and received the prize!"
|
||||
minetest.chat_send_all(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue