Kzah Posted April 24, 2015 Posted April 24, 2015 Hello, I have a little question. I would like a name color different for players in community (alt + B ). For exemple, a player in a faction has a blue color and an another player has a red color. After several tests, i have the same results : white, yellow, dark red or orignal blue. There is a specific list ? Or other color exist ? Thx ! /* RegionBBSManager.java */ // FACTION if (player.get_faction() == 2) { StringUtil.append(htmlCode, "<font color=\"" + Config.VALAKAS_NAME_COLOR_BBS + "\">", player.getName(), "</font>"); } if (player.get_faction() == 1) { StringUtil.append(htmlCode, "<font color=\"" + Config.ANTHARAS_NAME_COLOR_BBS + "\">", player.getName(), "</font>"); } else { htmlCode.append(player.getName()); } /* Config.java */ VALAKAS_NAME_COLOR_BBS = Integer.decode("0x" + CustomSettings.getString("ValakasNameColorBBs", "003300")); ANTHARAS_NAME_COLOR_BBS = Integer.decode("0x" + CustomSettings.getString("AntharasNameColorBBs", "003366")); Quote
0 SweeTs Posted April 24, 2015 Posted April 24, 2015 (edited) Config looks fine. Change the if if else, to if/else if/else // FACTION if (player.get_faction() == 2) StringUtil.append(htmlCode, "<font color=\"" + Config.VALAKAS_NAME_COLOR_BBS + "\">", player.getName(), "</font>"); else if (player.get_faction() == 1) StringUtil.append(htmlCode, "<font color=\"" + Config.ANTHARAS_NAME_COLOR_BBS + "\">", player.getName(), "</font>"); else htmlCode.append(player.getName()); If that doesn't fix it, try following. Dunno what pack are you using, but as I see you use getString(, try to replace it with getProperty(, if no error. :P Edited April 24, 2015 by SweeTs Quote
0 Kzah Posted April 24, 2015 Author Posted April 24, 2015 Thx for "else if" ! ;D But colors are same : white, yellow, dark red or orignal blue. :/ getProperty is'nt valide for me. "The getProperty (String, String) is undefined for the type PropertiesParser " L2J Datapack Version: 10402 L2J Server Version: 6608 Quote
0 Tryskell Posted April 24, 2015 Posted April 24, 2015 You have to know it's BGR, not RGB. And I think you can use plain text, such as "red", "blue", "green", etc. Quote
0 Kzah Posted April 24, 2015 Author Posted April 24, 2015 Doesn't work if i use plain text or if i test the BGR. :/ I don't understand the problem. :'( //Offline if (player.isOnlineInt() == 2) // 2 == en mode offline. { StringUtil.append(htmlCode, "<font color=\"" + Config.OFFLINE_NAME_COLOR_BBS + "\">", player.getName(), "</font>"); } // FACTION else if (player.get_faction() == 2) { StringUtil.append(htmlCode, "<font color=\"red\">", player.getName(), "</font>"); } else if (player.get_faction() == 1) { StringUtil.append(htmlCode, "<font color=\"blue\">", player.getName(), "</font>"); } else { htmlCode.append(player.getName()); } Quote
Question
Kzah
Hello,
I have a little question.
I would like a name color different for players in community (alt + B ).
For exemple, a player in a faction has a blue color and an another player has a red color.
After several tests, i have the same results : white, yellow, dark red or orignal blue.
There is a specific list ? Or other color exist ?
Thx !
/* RegionBBSManager.java */
/* Config.java */
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.