You still need to tell us a bit more about what exactly you want to achieve here.
- What exactly do you want to be played? Do you want the message to be read out, or a specific sound?
- Do you want to hear the sound, or do you want the contact to hear it?
JScript code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
switch (Message)
{
case "/sstart":
sEnabled = true;
return "";
case "/sstop":
sEnabled = false;
return "";
default:
if (sEnabled)
{
Message = Message.replace(/that/gi, "ðæt"); return Message;
}
break;
}
}
- What is the replace line for? Do you want to play the sound if the replacement occurs in the message?
Also, you should use [code=js] for syntax highlighting when posting your code here.