07.12.2013, 23:30
Hello, I have tried to make AntiSwear function which replaces bad words to ******
Here is my code, I have founded on forum, and copied, so tried to make but doesn't work..
I got errors in loops ( ill comment errors in code )
Please help me, rep++
Here is my code, I have founded on forum, and copied, so tried to make but doesn't work..
I got errors in loops ( ill comment errors in code )
Please help me, rep++

Код:
new BadWords[][] =
{
{"bot"},
{"noob"},
{"idiot"},
{"fuck"},
{"fag"}
};
stock AntiSwear(string[])
{
new s ;
while((s = strfind(string, BadWords[], true)) != -1) // error 029: invalid expression, assumed zero
{
for(new x = (s + strlen(BadWords[])); s != x; ++s) // error 029: invalid expression, assumed zero
{
string[s] = '*';
}
}
return 1;
}
// So usage would be:
// Ex:
public OnPlayerText(playerid, text)
{
AntiSwear(text);
return 0;
}


