03.03.2016, 14:09
Quote:
|
An alternative would be to split the spring into words and compare each words, then join it back together.
|

A better solution (here only the operation principle):
Код:
public OnPlayerText(playerid, text[])
{
for(new i, j, p, s, t; i < num_s; ++i)
{
t = 0;
while((j = strfind(text, Swears[i], true, t)) != -1)
{
s = j + strlen(Swears[i]);
for(p = 0; p < num_e; ++p)
{
if(!(-1 < strfind(text, Exceptions[p], true, t) < s) || strfind(Exceptions[p], Swears[i], true) == -1)
{
if(p == num_e - 1)
{
for(; j < s; ++j) text[j] = '*';
}
continue;
}
else
{
t = s;
break;
}
}
}
}
return 1;
}


