Adaption for CTF

This commit is contained in:
philipmi 2022-02-06 20:59:31 +01:00
parent 8241217e4a
commit ccafa95bd0
3 changed files with 3 additions and 2 deletions

View file

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

View file

@ -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},

View file

@ -1,3 +1,3 @@
name = playerlist
description = The playerlist feature (extracted from the elidragon mod)
depends = controls
depends = controls, ctf, ctf_colors