From ccafa95bd0816344ec6c1662cffaf21e128988bc Mon Sep 17 00:00:00 2001 From: philipmi Date: Sun, 6 Feb 2022 20:59:31 +0100 Subject: [PATCH] Adaption for CTF --- README.md | 2 +- init.lua | 1 + mod.conf | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ed4d07..edfb63d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# playerlist +# playerlist for ctf Show a list of all online players (similar to minecrafts tab-list) when a player is pressing the playerlist key (by default: sneak). Provides an API that can be used to hide or nick players, sort them and display them with different colors. (E.g. Display admins at the top of the list and make their name red). There is also a ping bar for every player (<= 20ms -> 4, <= 40ms -> 3, <= 60ms -> 2, > 60ms -> 1). diff --git a/init.lua b/init.lua index 5631445..1c2f6fa 100644 --- a/init.lua +++ b/init.lua @@ -27,6 +27,7 @@ controls.register_on_press(function(user, key) for i, player, color, text in playerlist.iterator() do local name = player:get_player_name() local ping = math.max(1, math.ceil(4 - (minetest.get_player_information(name).avg_rtt or 0) * 50)) + local color = color or ctf_colors.get_color(ctf.player(name)).hex table.insert(huds, user:hud_add({ hud_elem_type = "text", position = {x = 0.5, y = 0}, diff --git a/mod.conf b/mod.conf index 8d3cb26..646f1f2 100644 --- a/mod.conf +++ b/mod.conf @@ -1,3 +1,3 @@ name = playerlist description = The playerlist feature (extracted from the elidragon mod) -depends = controls +depends = controls, ctf, ctf_colors