Here is a significantly better version. The only problem with this is that people will be allowed to use any TML control chars they want (change font, size, etc) Thanks Trinick
package tmlChat
{
function serverCmdMessageSent(%client,%message)
{
%message = stripMLControlChars(%message);
%message = strReplace(%message,":)","<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
$DoNotStripMLControlChars = 1;
parent::serverCmdMessageSent(%client,%message);
$DoNotStripMLControlChars = "";
}
function stripMLControlChars(%flag)
{
if($DoNotStripMLControlChars)
return %flag;
return parent::stripMLControlChars(%flag);
}
};
activatePackage(tmlChat);
Also, this would make a lot more sense as a client add-on.