quote:
Originally posted by hmaster
Or you could split the message into 2 parts and do
[c=1]FirstPart[/c=2][c=2]SecondPart[/c=3]
Should be easy to count the number of chars divide by two and substr it
var Color1 = 1;
var Color2 = 2;
var Color3 = 3;
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
var part1 = Message.substr(0, Math.floor(Message.length / 2));
var part2 = Message.substr(Math.floor(Message.length / 2));
return "[c=" + Color1 + "]" + part1 + "[/c=" + Color2 + "][c=" + Color2 + "]" + part2 + "[/c=" + Color3 +"]";
}