The correct behavior for a function is to stop after returning IIRC, but if this happends use this:
code:
var MsgOutput = null;
var Color1 = null;
var Color2 = null;
var sendUnaltered = true;
function Replace_Text(Color1, Color2, Message, MsgOutput)
{
return "[c=" + Color1 + "]" + Message + "[/c=" + Color2 + "]";
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
var Contacts = ChatWnd.Contacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
if (Contact.Email == nemo_569@hotmail.com)
{
Color1 = "#010176";
Color2 = "#2D0352";
return Replace_Text(Color1, Color2, Message, MsgOutput);
sendUnaltered = false;
}
}
if(sendUnaltered)
{
return Message;
}
}
EDIT: replaced the bool variable with a more understandable variable: sendUnaltered