Add player skins to match team color

master
rubenwardy 2015-09-07 10:49:22 +01:00
parent 4d00a8cf1d
commit b8b6ff76e7
4 changed files with 18 additions and 2 deletions

View File

@ -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", {

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB