if ((text.charAt(0) == ':') && activeChar.isVIP())
{
CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), "[VIP] "+text);
for (L2PcInstance player : L2World.getInstance().getAllPlayersArray())
{
if (player.isVIP())
{
player.sendPacket(cs);
}
}
}
Working.
Thanks both to you.
Edit : I guess colors for chat are in client?
Edit 2 :
if ((text.charAt(0) == ':') && activeChar.isVIP())
{
StringBuffer temptext = new StringBuffer(text);
temptext.deleteCharAt(0);
String text2 = "";
text2 = text2+ temptext.toString();
text2 = ':' + ' ' + text; // For an easy read.
CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), "[VIP Channel] "+text2);
I want to delete the character ':' from the string. INGAME it's look like : Pseudo: [VIP Channel] 122:test
Why 122 and not : "Pseudo: [VIP Channel] : text" ?