как внутри игры сконвертировать playercolor в RGB значения ?
вопрос именно не покраска, как в этой теме, а получить точное значение из игры
или может они в game.dll где-то прописаны?
common.j
    constant playercolor	PLAYER_COLOR_RED		= ConvertPlayerColor(0)
    constant playercolor	PLAYER_COLOR_BLUE	       = ConvertPlayerColor(1)
    constant playercolor	PLAYER_COLOR_CYAN	       = ConvertPlayerColor(2)
    constant playercolor	PLAYER_COLOR_PURPLE	     = ConvertPlayerColor(3)
    constant playercolor	PLAYER_COLOR_YELLOW	     = ConvertPlayerColor(4)
    constant playercolor	PLAYER_COLOR_ORANGE	     = ConvertPlayerColor(5)
    constant playercolor	PLAYER_COLOR_GREEN	      = ConvertPlayerColor(6)
    constant playercolor	PLAYER_COLOR_PINK	       = ConvertPlayerColor(7)
    constant playercolor	PLAYER_COLOR_LIGHT_GRAY	 = ConvertPlayerColor(8)
    constant playercolor	PLAYER_COLOR_LIGHT_BLUE	 = ConvertPlayerColor(9)
    constant playercolor	PLAYER_COLOR_AQUA	       = ConvertPlayerColor(10)
    constant playercolor	PLAYER_COLOR_BROWN	      = ConvertPlayerColor(11)
    constant playercolor	PLAYER_COLOR_MAROON	     = ConvertPlayerColor(12)
    constant playercolor	PLAYER_COLOR_NAVY	       = ConvertPlayerColor(13)
    constant playercolor	PLAYER_COLOR_TURQUOISE	  = ConvertPlayerColor(14)
    constant playercolor	PLAYER_COLOR_VIOLET	     = ConvertPlayerColor(15)
    constant playercolor	PLAYER_COLOR_WHEAT	      = ConvertPlayerColor(16)
    constant playercolor	PLAYER_COLOR_PEACH	      = ConvertPlayerColor(17)
    constant playercolor	PLAYER_COLOR_MINT	       = ConvertPlayerColor(18)
    constant playercolor	PLAYER_COLOR_LAVENDER	   = ConvertPlayerColor(19)
    constant playercolor	PLAYER_COLOR_COAL	       = ConvertPlayerColor(20)
    constant playercolor	PLAYER_COLOR_SNOW	       = ConvertPlayerColor(21)
    constant playercolor	PLAYER_COLOR_EMERALD	    = ConvertPlayerColor(22)
    constant playercolor	PLAYER_COLOR_PEANUT	     = ConvertPlayerColor(23)
на разных сайтах выдают списки с отличающимися кодами, для одного только красного есть три вариации:
FF0000
FF0202
FF0303
поэтому надо внутри игры получить точные значения уже

Vanilla

Player # Color HEX jass RGB
00 01 PLAYER_COLOR_RED FF0303 |cffFF0303|r 255,3,3
01 02 PLAYER_COLOR_BLUE 0042FF |cff0042FF|r 0,66,255
02 03 PLAYER_COLOR_CYAN 1CE6B9 |cff1CE6B9|r 28,230,185
03 04 PLAYER_COLOR_PURPLE 540081 |cff540081|r 84,0,129
04 05 PLAYER_COLOR_YELLOW FFFC01 |cffFFFC01|r 255,252,1
05 06 PLAYER_COLOR_ORANGE FE8A0E |cffFE8A0E|r 254,138,14
06 07 PLAYER_COLOR_GREEN 20C000 |cff20C000|r 32,192,0
07 08 PLAYER_COLOR_PINK E55BB0 |cffE55BB0|r 229,91,176
08 09 PLAYER_COLOR_LIGHT_GRAY 959697 |cff959697|r 149,150,151
09 10 PLAYER_COLOR_LIGHT_BLUE 7EBFF1 |cff7EBFF1|r 126,191,241
10 11 PLAYER_COLOR_AQUA 106246 |cff106246|r 16,98,70
11 12 PLAYER_COLOR_BROWN 4E2A04 |cff4E2A04|r 78,42,4
12 13 282828 |cff282828|r 40,40,40
13 14 282828 |cff282828|r 40,40,40
14 15 282828 |cff282828|r 40,40,40
15 16 282828 |cff282828|r 40,40,40

Reforged

Player # Color HEX jass RGB
00 01 PLAYER_COLOR_RED F80402 |cffF80402|r 248,4,2
01 02 PLAYER_COLOR_BLUE 0041F8 |cff0041F8|r 0,65,248
02 03 PLAYER_COLOR_CYAN 1AE4B5 |cff1AE4B5|r 26,228,181
03 04 PLAYER_COLOR_PURPLE 52007D |cff52007D|r 82,0,125
04 05 PLAYER_COLOR_YELLOW F8F900 |cffF8F900|r 248,249,0
05 06 PLAYER_COLOR_ORANGE F8880D |cffF8880D|r 248,136,13
06 07 PLAYER_COLOR_GREEN 20BD00 |cff20BD00|r 32,189,0
07 08 PLAYER_COLOR_PINK DD5AAA |cffDD5AAA|r 221,90,170
08 09 PLAYER_COLOR_LIGHT_GRAY 909492 |cff909492|r 144,148,146
09 10 PLAYER_COLOR_LIGHT_BLUE 7ABDEA |cff7ABDEA|r 122,189,234
10 11 PLAYER_COLOR_AQUA 106145 |cff106145|r 16,97,69
11 12 PLAYER_COLOR_BROWN 4D2A05 |cff4D2A05|r 77,42,5
12 13 PLAYER_COLOR_MAROON 980000 |cff980000|r 152,0,0
13 14 PLAYER_COLOR_NAVY 0000BD |cff0000BD|r 0,0,189
14 15 PLAYER_COLOR_TURQUOISE 00E8F8 |cff00E8F8|r 0,232,248
15 16 PLAYER_COLOR_VIOLET B800F8 |cffB800F8|r 184,0,248
16 17 PLAYER_COLOR_WHEAT E5CA82 |cffE5CA82|r 229,202,130
17 18 PLAYER_COLOR_PEACH F0A288 |cffF0A288|r 240,162,136
18 19 PLAYER_COLOR_MINT BAFC7D |cffBAFC7D|r 186,252,125
19 20 PLAYER_COLOR_LAVENDER D5B6E5 |cffD5B6E5|r 213,182,229
20 21 PLAYER_COLOR_COAL 4D4E52 |cff4D4E52|r 77,78,82
21 22 PLAYER_COLOR_SNOW E5EDF8 |cffE5EDF8|r 229,237,248
22 23 PLAYER_COLOR_EMERALD 00761D |cff00761D|r 0,118,29
23 24 PLAYER_COLOR_PEANUT A06E32 |cffA06E32|r 160,110,50
24 25 2D2D2D |cff2D2D2D|r 45,45,45
25 26 2D2D2D |cff2D2D2D|r 45,45,45
26 27 2D2D2D |cff2D2D2D|r 45,45,45
27 28 2D2D2D |cff2D2D2D|r 45,45,45

У есть игры текстуры цветов, находящиеся по путям, указаным в ключах "TeamColor" и "TeamGlow" файла "war3skins.txt".
[Default]
TeamColors=16
TeamColor=ReplaceableTextures\TeamColor\TeamColor
TeamGlow=ReplaceableTextures\TeamGlow\TeamGlow
Цвета имен игроков получаются путем извлечения первого пикселя текстуры командного цвета.
Чтобы получить путь к текстуре, нужно приклеить к пути из "TeamColor" номер игрока с нулем в начале и расширение ".tga" или ".blp", если первый вариант не нашелся.
Пример:
Игрок Путь к текстуре
Красный ReplaceableTextures\TeamColor\TeamColor00.blp
Синий ReplaceableTextures\TeamColor\TeamColor01.blp
Цвета игроков от нулевого до шестнадцатого
FFFF0303
FF0042FF
FF1CE6B9
FF540081
FFFFFC01
FFFE8A0E
FF20C000
FFE55BB0
FF959697
FF7EBFF1
FF106246
FF4E2A04
FF282828
FF282828
FF282828
FF282828
`
ОЖИДАНИЕ РЕКЛАМЫ...

Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
38
А пипеткой через microsoft powertoys не вариант?
14
пипеткой
это погрешность
указано же, что пипеточники на красный цвет напипеткали аж 3 значения - FF0000 FF0202 FF0303 , и какой из них верный?
надо именно из кода игры получить
а еще может быть в разных патчах разные цвета прописаны, стопудов в game.dll сидят они
19
У есть игры текстуры цветов, находящиеся по путям, указаным в ключах "TeamColor" и "TeamGlow" файла "war3skins.txt".
[Default]
TeamColors=16
TeamColor=ReplaceableTextures\TeamColor\TeamColor
TeamGlow=ReplaceableTextures\TeamGlow\TeamGlow
Цвета имен игроков получаются путем извлечения первого пикселя текстуры командного цвета.
Чтобы получить путь к текстуре, нужно приклеить к пути из "TeamColor" номер игрока с нулем в начале и расширение ".tga" или ".blp", если первый вариант не нашелся.
Пример:
Игрок Путь к текстуре
Красный ReplaceableTextures\TeamColor\TeamColor00.blp
Синий ReplaceableTextures\TeamColor\TeamColor01.blp
Цвета игроков от нулевого до шестнадцатого
FFFF0303
FF0042FF
FF1CE6B9
FF540081
FFFFFC01
FFFE8A0E
FF20C000
FFE55BB0
FF959697
FF7EBFF1
FF106246
FF4E2A04
FF282828
FF282828
FF282828
FF282828
Принятый ответ
14
первый пост обновлён с точными данными
прикреплены файлы blp dds png с цветами
Загруженные файлы
14
цветовые функции:
первая определяет код цвета по игровой константе
вторая красит строку

Vanilla

Код
function GetColorClassic takes player p returns string
	local playercolor color = GetPlayerColor(p)
	if color==PLAYER_COLOR_RED then
		return "FF0303" //1
	elseif color==PLAYER_COLOR_BLUE then
		return "0042FF" //2
	elseif color==PLAYER_COLOR_CYAN then
		return "1CE6B9" //3
	elseif color==PLAYER_COLOR_PURPLE then
		return "540081" //4
	elseif color==PLAYER_COLOR_YELLOW then
		return "FFFC01" //5
	elseif color==PLAYER_COLOR_ORANGE then
		return "FEBA0E" //6
	elseif color==PLAYER_COLOR_GREEN then
		return "20C000" //7
	elseif color==PLAYER_COLOR_PINK then
		return "E55BB0" //8
	elseif color==PLAYER_COLOR_LIGHT_GRAY then
		return "959697" //9
	elseif color==PLAYER_COLOR_LIGHT_BLUE then
		return "7EBFF1" //10
	elseif color==PLAYER_COLOR_AQUA then
		return "106246" //11
	elseif color==PLAYER_COLOR_BROWN then
		return "4E2A04" //12
	endif
	return ""
endfunction
function Color00PlayerRedClassic takes string s returns string //1 - 255,3,3
	return "|c"+"ff"+"FF0303"+s+"|r"
endfunction
function Color01PlayerBlueClassic takes string s returns string //2 - 0,66,255
	return "|c"+"ff"+"0042FF"+s+"|r"
endfunction
function Color02PlayerCyanClassic takes string s returns string //3 - 28,230,185
	return "|c"+"ff"+"1CE6B9"+s+"|r"
endfunction
function Color03PlayerPurpleClassic takes string s returns string //4 - 84,0,129
	return "|c"+"ff"+"540081"+s+"|r"
endfunction
function Color04PlayerYellowClassic takes string s returns string //5 - 255,252,1
	return "|c"+"ff"+"FFFC01"+s+"|r"
endfunction
function Color05PlayerOrangeClassic takes string s returns string //6 - 254,138,14
	return "|c"+"ff"+"FEBA0E"+s+"|r"
endfunction
function Color06PlayerGreenClassic takes string s returns string //7 - 32,192,0
	return "|c"+"ff"+"20C000"+s+"|r"
endfunction
function Color07PlayerPinkClassic takes string s returns string //8 - 229,91,176
	return "|c"+"ff"+"E55BB0"+s+"|r"
endfunction
function Color08PlayerLightGrayClassic takes string s returns string //9 - 149,150,151
	return "|c"+"ff"+"959697"+s+"|r"
endfunction
function Color09PlayerLightBlueClassic takes string s returns string //10 - 126,191,241
	return "|c"+"ff"+"7EBFF1"+s+"|r"
endfunction
function Color10PlayerAquaClassic takes string s returns string //11 - 16,98,70
	return "|c"+"ff"+"106246"+s+"|r"
endfunction
function Color11PlayerBrownClassic takes string s returns string //12 - 78,42,4
	return "|c"+"ff"+"4E2A04"+s+"|r"
endfunction

Reforged

Код
function GetColorReforged takes player p returns string
	local playercolor color = GetPlayerColor(p)
	if color==PLAYER_COLOR_RED then
		return "F80402" //1
	elseif color==PLAYER_COLOR_BLUE then
		return "0041F8" //2
	elseif color==PLAYER_COLOR_CYAN then
		return "1AE4B5" //3
	elseif color==PLAYER_COLOR_PURPLE then
		return "52007D" //4
	elseif color==PLAYER_COLOR_YELLOW then
		return "F8F900" //5
	elseif color==PLAYER_COLOR_ORANGE then
		return "F8880D" //6
	elseif color==PLAYER_COLOR_GREEN then
		return "20BD00" //7
	elseif color==PLAYER_COLOR_PINK then
		return "DD5AAA" //8
	elseif color==PLAYER_COLOR_LIGHT_GRAY then
		return "909492" //9
	elseif color==PLAYER_COLOR_LIGHT_BLUE then
		return "7ABDEA" //10
	elseif color==PLAYER_COLOR_AQUA then
		return "106145" //11
	elseif color==PLAYER_COLOR_BROWN then
		return "4D2A05" //12
	elseif color==PLAYER_COLOR_MAROON then
		return "980000" //13
	elseif color==PLAYER_COLOR_NAVY then
		return "0000BD" //14
	elseif color==PLAYER_COLOR_TURQUOISE then
		return "00E8F8" //15
	elseif color==PLAYER_COLOR_VIOLET then
		return "B800F8" //16
	elseif color==PLAYER_COLOR_WHEAT then
		return "E5CA82" //17
	elseif color==PLAYER_COLOR_PEACH then
		return "F0A288" //18
	elseif color==PLAYER_COLOR_MINT then
		return "BAFC7D" //19
	elseif color==PLAYER_COLOR_LAVENDER then
		return "D5B6E5" //20
	elseif color==PLAYER_COLOR_COAL then
		return "4D4E52" //21
	elseif color==PLAYER_COLOR_SNOW then
		return "E5EDF8" //22
	elseif color==PLAYER_COLOR_EMERALD then
		return "00761D" //23
	elseif color==PLAYER_COLOR_PEANUT then
		return "A06E32" //24
	endif
	return ""
endfunction
function Color00PlayerRedReforged takes string s returns string //1 - 248,4,2
	return "|c"+"ff"+"F80402"+s+"|r"
endfunction
function Color01PlayerBlueReforged takes string s returns string //2 - 0,65,248
	return "|c"+"ff"+"0041F8"+s+"|r"
endfunction
function Color02PlayerCyanReforged takes string s returns string //3 - 26,228,181
	return "|c"+"ff"+"1AE4B5"+s+"|r"
endfunction
function Color03PlayerPurpleReforged takes string s returns string //4 - 82,0,125
	return "|c"+"ff"+"52007D"+s+"|r"
endfunction
function Color04PlayerYellowReforged takes string s returns string //5 - 248,249,0
	return "|c"+"ff"+"F8F900"+s+"|r"
endfunction
function Color05PlayerOrangeReforged takes string s returns string //6 - 248,136,13
	return "|c"+"ff"+"F8880D"+s+"|r"
endfunction
function Color06PlayerGreenReforged takes string s returns string //7 - 32,189,0
	return "|c"+"ff"+"20BD00"+s+"|r"
endfunction
function Color07PlayerPinkReforged takes string s returns string //8 - 221,90,170
	return "|c"+"ff"+"DD5AAA"+s+"|r"
endfunction
function Color08PlayerLightGrayReforged takes string s returns string //9 - 144,148,146
	return "|c"+"ff"+"909492"+s+"|r"
endfunction
function Color09PlayerLightBlueReforged takes string s returns string //10 - 122,189,234
	return "|c"+"ff"+"7ABDEA"+s+"|r"
endfunction
function Color10PlayerAquaReforged takes string s returns string //11 - 16,97,69
	return "|c"+"ff"+"106145"+s+"|r"
endfunction
function Color11PlayerBrownReforged takes string s returns string //12 - 77,42,5
	return "|c"+"ff"+"4D2A05"+s+"|r"
endfunction
function Color12PlayerMaroonReforged takes string s returns string //13 - 152,0,0
	return "|c"+"ff"+"980000"+s+"|r"
endfunction
function Color13PlayerNavyReforged takes string s returns string //14 - 0,0,189
	return "|c"+"ff"+"0000BD"+s+"|r"
endfunction
function Color14PlayerTurquoiseReforged takes string s returns string //15 - 0,232,248
	return "|c"+"ff"+"00E8F8"+s+"|r"
endfunction
function Color15PlayerVioletReforged takes string s returns string //16 - 184,0,248
	return "|c"+"ff"+"B800F8"+s+"|r"
endfunction
function Color16PlayerWheatReforged takes string s returns string //17 - 229,202,130
	return "|c"+"ff"+"E5CA82"+s+"|r"
endfunction
function Color17PlayerPeachReforged takes string s returns string //18 - 240,162,136
	return "|c"+"ff"+"F0A288"+s+"|r"
endfunction
function Color18PlayerMintReforged takes string s returns string //19 - 186,252,125
	return "|c"+"ff"+"BAFC7D"+s+"|r"
endfunction
function Color19PlayerLavenderReforged takes string s returns string //20 - 213,182,229
	return "|c"+"ff"+"D5B6E5"+s+"|r"
endfunction
function Color20PlayerCoalReforged takes string s returns string //21 - 77,78,82
	return "|c"+"ff"+"4D4E52"+s+"|r"
endfunction
function Color21PlayerSnowReforged takes string s returns string //22 - 229,237,248
	return "|c"+"ff"+"E5EDF8"+s+"|r"
endfunction
function Color22PlayerEmeraldReforged takes string s returns string //23 - 0,118,29
	return "|c"+"ff"+"00761D"+s+"|r"
endfunction
function Color23PlayerPeanutReforged takes string s returns string //24 - 160,110,50
	return "|c"+"ff"+"A06E32"+s+"|r"
endfunction
Загруженные файлы
Ответы (3)
25
Да и для рефа можно было бы и не делать простыню элсифов на джассе
PlayerColorConstants = {
    [PLAYER_COLOR_RED] = "F80402", -- 1
    [PLAYER_COLOR_BLUE] = "0041F8", -- 2
    [PLAYER_COLOR_CYAN] = "1AE4B5", -- 3
    [PLAYER_COLOR_PURPLE] = "52007D", -- 4
    [PLAYER_COLOR_YELLOW] = "F8F900", -- 5
    [PLAYER_COLOR_ORANGE] = "F8880D", -- 6
    [PLAYER_COLOR_GREEN] = "20BD00", -- 7
    [PLAYER_COLOR_PINK] = "DD5AAA", -- 8
    [PLAYER_COLOR_LIGHT_GRAY] = "909492", -- 9
    [PLAYER_COLOR_LIGHT_BLUE] = "7ABDEA", -- 10
    [PLAYER_COLOR_AQUA] = "106145", -- 11
    [PLAYER_COLOR_BROWN] = "4D2A05", -- 12
}

function GetColorReforged(player)
    return PlayerColorConstants[GetPlayerColor(player)] or ""
end
14
покраска строки цветом игрока
function ColorPlayer takes string s, integer i returns string
if 1==0 then
elseif i==1 then
return ColorPlayerRed(s)
elseif i==2 then
return ColorPlayerBlue(s)
elseif i==3 then
return ColorPlayerCyan(s)
elseif i==4 then
return ColorPlayerPurple(s)
elseif i==5 then
return ColorPlayerYellow(s)
elseif i==6 then
return ColorPlayerOrange(s)
elseif i==7 then
return ColorPlayerGreen(s)
elseif i==8 then
return ColorPlayerPink(s)
elseif i==9 then
return ColorPlayerLightGray(s)
elseif i==10 then
return ColorPlayerLightBlue(s)
elseif i==11 then
return ColorPlayerAqua(s)
elseif i==12 then
return ColorPlayerBrown(s)
endif
return null
endfunction
Ответы (1)
38
host_pi, а где для 24 игроков?
14
покраска строки цветом игрока

Vanilla

Код
function ColorPlayerClassic takes string s, integer i returns string
if 1==0 then
elseif i==1 then
return Color00PlayerRedClassic(s)
elseif i==2 then
return Color01PlayerBlueClassic(s)
elseif i==3 then
return Color02PlayerCyanClassic(s)
elseif i==4 then
return Color03PlayerPurpleClassic(s)
elseif i==5 then
return Color04PlayerYellowClassic(s)
elseif i==6 then
return Color05PlayerOrangeClassic(s)
elseif i==7 then
return Color06PlayerGreenClassic(s)
elseif i==8 then
return Color07PlayerPinkClassic(s)
elseif i==9 then
return Color08PlayerLightGrayClassic(s)
elseif i==10 then
return Color09PlayerLightBlueClassic(s)
elseif i==11 then
return Color10PlayerAquaClassic(s)
elseif i==12 then
return Color11PlayerBrownClassic(s)
endif
return null
endfunction

Reforged

Код
function ColorPlayerReforged takes string s, integer i returns string
if 1==0 then
elseif i==1 then
return Color00PlayerRedReforged(s)
elseif i==2 then
return Color01PlayerBlueReforged(s)
elseif i==3 then
return Color02PlayerCyanReforged(s)
elseif i==4 then
return Color03PlayerPurpleReforged(s)
elseif i==5 then
return Color04PlayerYellowReforged(s)
elseif i==6 then
return Color05PlayerOrangeReforged(s)
elseif i==7 then
return Color06PlayerGreenReforged(s)
elseif i==8 then
return Color07PlayerPinkReforged(s)
elseif i==9 then
return Color08PlayerLightGrayReforged(s)
elseif i==10 then
return Color09PlayerLightBlueReforged(s)
elseif i==11 then
return Color10PlayerAquaReforged(s)
elseif i==12 then
return Color11PlayerBrownReforged(s)
elseif i==13 then
return Color12PlayerMaroonReforged(s)
elseif i==14 then
return Color13PlayerNavyReforged(s)
elseif i==15 then
return Color14PlayerTurquoiseReforged(s)
elseif i==16 then
return Color15PlayerVioletReforged(s)
elseif i==17 then
return Color16PlayerWheatReforged(s)
elseif i==18 then
return Color17PlayerPeachReforged(s)
elseif i==19 then
return Color18PlayerMintReforged(s)
elseif i==20 then
return Color19PlayerLavenderReforged(s)
elseif i==21 then
return Color20PlayerCoalReforged(s)
elseif i==22 then
return Color21PlayerSnowReforged(s)
elseif i==23 then
return Color22PlayerEmeraldReforged(s)
elseif i==24 then
return Color23PlayerPeanutReforged(s)
endif
return null
endfunction
23
Вариант наработки покраски цветом игрока через массивы, без elseif-ов, для 1.26
globals
    constant playercolor  PLAYER_COLOR_BLACK =  ConvertPlayerColor(12)
    playercolor array  bj_PlayerColors
    string array  bj_PlayerColorPrefiks
endglobals

function InitPlayerColors takes nothing returns nothing
    // Запускать на старте игры
    set bj_PlayerColors[0]  = PLAYER_COLOR_RED
    set bj_PlayerColors[1]  = PLAYER_COLOR_BLUE
    set bj_PlayerColors[2]  = PLAYER_COLOR_CYAN
    set bj_PlayerColors[3]  = PLAYER_COLOR_PURPLE
    set bj_PlayerColors[4]  = PLAYER_COLOR_YELLOW
    set bj_PlayerColors[5]  = PLAYER_COLOR_ORANGE
    set bj_PlayerColors[6]  = PLAYER_COLOR_GREEN
    set bj_PlayerColors[7]  = PLAYER_COLOR_PINK
    set bj_PlayerColors[8]  = PLAYER_COLOR_LIGHT_GRAY
    set bj_PlayerColors[9]  = PLAYER_COLOR_LIGHT_BLUE
    set bj_PlayerColors[10] = PLAYER_COLOR_AQUA
    set bj_PlayerColors[11] = PLAYER_COLOR_BROWN
    set bj_PlayerColors[12] = PLAYER_COLOR_BLACK
    set bj_PlayerColorPrefiks[0] =  "|c00FF0302"
    set bj_PlayerColorPrefiks[1] =  "|c000142FF"
    set bj_PlayerColorPrefiks[2] =  "|c001CE5B9"
    set bj_PlayerColorPrefiks[3] =  "|c008D30C8"
    set bj_PlayerColorPrefiks[4] =  "|c00FFFC01"
    set bj_PlayerColorPrefiks[5] =  "|c00FE8B0E"
    set bj_PlayerColorPrefiks[6] =  "|c0020BF00"
    set bj_PlayerColorPrefiks[7] =  "|c00E55BB0"
    set bj_PlayerColorPrefiks[8] =  "|c00959698"
    set bj_PlayerColorPrefiks[9] =  "|c007DBFF1"
    set bj_PlayerColorPrefiks[10] = "|c0030906A"
    set bj_PlayerColorPrefiks[11] = "|c007E4F30"
    set bj_PlayerColorPrefiks[12] = "|c00606060"
endfunction

function ConvertIndexPlayerColor takes playercolor color returns integer
local integer index = 0
    loop
    exitwhen color == bj_PlayerColors[index] or index == 12
        set index = index + 1
    endloop
    return index
endfunction

function GetPlayerColorText takes player p, string str returns string 
local integer index = ConvertIndexPlayerColor( GetPlayerColor(p) )
    return bj_PlayerColorPrefiks[index] + str + "|r"
endfunction
Ответы (3)
14
EugeAl: bj_
щас бы кастомным глобалкам bj_ подписывать
23
host_pi, я просто этот кусок кода выдрал из своего bj файла, для удобства разделил кастомные глобалки на "общие" и "только для мода", "общие" подписал как bj_. Всё просто для собственной же удобочитаемости )
28
host_pi, я часто прописываю bj_lastFilterUnit, глазу приятнее что-ли. Но, пожалуй, это исключение, на которое меня натолкнул quq_CCCP
Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
Чтобы оставить комментарий, пожалуйста, войдите на сайт.