Add player skins to match team color
This commit is contained in:
parent
4d00a8cf1d
commit
b8b6ff76e7
@ -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
|
||||
|
||||
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", {
|
||||
|
BIN
ctf_colors/textures/ctf_colors_skin_blue.png
Normal file
BIN
ctf_colors/textures/ctf_colors_skin_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
BIN
ctf_colors/textures/ctf_colors_skin_green.png
Normal file
BIN
ctf_colors/textures/ctf_colors_skin_green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
ctf_colors/textures/ctf_colors_skin_red.png
Normal file
BIN
ctf_colors/textures/ctf_colors_skin_red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Loading…
x
Reference in New Issue
Block a user