17.09.2010, 22:41
(
Последний раз редактировалось RyDeR`; 18.09.2010 в 08:28.
)
Info
Replaces a swear word with a '*' char.
Code
Usage/Example
This wil replace for example "bitch" with "*****".
Replaces a swear word with a '*' char.
Code
pawn Код:
stock replaceSwear(string[], badWord[], replace = '*')
{
new
i
;
while((i = strfind(string, badWord, true)) != -1)
{
for(new x = (i + strlen(badWord)); i != x; ++i)
{
string[i] = replace;
}
}
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
new
badWords[][] =
{
"bitch",
"ass",
"fuck"
}
;
for(new i; i != sizeof(badWords); ++i)
{
replaceSwear(text, badWords[i]);
}
return 1;
}