I mean like this:
$Pref::Server::CurseList
and
$Pref::Server::ETardList
Ok so basically I'm gunna redo the isClean() function because we're changing the way we get clean strings.
function serverCmdMessageSent(%client,%msg)
{
if(!isClean(%msg)){return;} // <--- don't send the msg if it's not clean
messageAll('chatMsg','\c4%1: %2',%client.name,%msg);
}
function isClean(%string)
{
%curses=$pref::server::CurseList;
%etards=$pref::server::ETardList;
%curses=splitBy(%curses, "," ,"Curse","CurseCount");
%etards=splitBy(%etards, "," ,"ETard","ETardCount");
for(%i=1;%i<=$pref::server::curseCount;%i++)
{
if(strStr(strLwr(%string),strLwr($pref::server::curse[%i])>=0){return 1;}
}
for(%i=0;%i<getWordCount(%string);%i++)
{
for(%t=1;%i<=$pref::server::ETardCount;%t++)
{
if(getWord(%string,%i) $= $pref::server::Etard[%t]){return 1;}
}
}
return 0;
}
function splitBy(%string,%splitChar,%elementSuffix,%countSuffix)
{
%string=strReplace(%string," "@%splitChar,%splitChar);
%string=strReplace(%string,%splitChar@" ",%splitChar);
// These two commands turn "1 , 2 , 3" into "1,2,3"
%pre="$Pref::Server::";
%element=%pre@%elementSuffix;
%count=%pre@%countSuffix;
eval(%count@"=1;");
for(%i=1;%i<=strLen(%string);%i++)
{
%char=getSubStr(%string,%i-1,1);
if(%char $= %splitChar){eval(%count@"++;");}
else
{
eval("%c="@%count@";");
eval(%element@"["@%c@"]="@%element@"["@%c@"]@\""@%char@"\";");
}
}
}