diff --git a/ctf_colors/init.lua b/ctf_colors/init.lua index 42f8792..65f0c12 100644 --- a/ctf_colors/init.lua +++ b/ctf_colors/init.lua @@ -13,12 +13,28 @@ ctf.flag_colors = { gold = "0x808000" } +ctf.register_on_init(function() + ctf.log("colors", "Initialising...") + ctf._set("colors.skins", false) + ctf._set("colors.nametag", true) +end) + ctf.hud.register_part(function(player, name, tplayer) - local color = ctf.flag_colors[ctf.team(tplayer.team).data.color] + local text_color = ctf.team(tplayer.team).data.color + local color = ctf.flag_colors[text_color] if not color then color = "0x000000" end - player:set_nametag_attributes({ color = "0xFF" .. string.sub(color, 3) }) + + if ctf.setting("colors.nametag") then + player:set_nametag_attributes({ color = "0xFF" .. string.sub(color, 3) }) + end + + if ctf.setting("colors.skins") and text_color and color then + player:set_properties({ + textures = {"ctf_colors_skin_" .. text_color .. ".png"}, + }) + end if not ctf.hud:exists(player, "ctf:hud_team") then ctf.hud:add(player, "ctf:hud_team", { diff --git a/ctf_colors/textures/ctf_colors_skin_blue.png b/ctf_colors/textures/ctf_colors_skin_blue.png new file mode 100644 index 0000000..6b711ed Binary files /dev/null and b/ctf_colors/textures/ctf_colors_skin_blue.png differ diff --git a/ctf_colors/textures/ctf_colors_skin_green.png b/ctf_colors/textures/ctf_colors_skin_green.png new file mode 100644 index 0000000..0502178 Binary files /dev/null and b/ctf_colors/textures/ctf_colors_skin_green.png differ diff --git a/ctf_colors/textures/ctf_colors_skin_red.png b/ctf_colors/textures/ctf_colors_skin_red.png new file mode 100644 index 0000000..8214fb5 Binary files /dev/null and b/ctf_colors/textures/ctf_colors_skin_red.png differ