Quote:
Originally Posted by S4t3K
@Roel : You should create your array with a dynamic size
PHP код:
new InvalidNames[][20] =
{
"bitch", "noob", "rage", "ass" // You can add as many words as you want
};
public OnPlayerText(playerid, text[])
{
for(new fw = 0; fw < sizeof(InvalidNames); fw++)
{
if(strfind(text, InvalidNames[fw], true) != -1)
{
new replacement[20], replacement1[20], pos[2];
pos[0] = strfind(text, InvalidNames[fw], true);
pos[1] = strfind(text, ' ', true, pos[0]);
strmid(replacement, text, pos[0], pos[1]);
strdel(text, pos[0], pos[1]);
for(new i = 0; i < strlen(replacement); i++)
{
if(replacement[i] != '*') replacement[i] = '*';
}
strins(text, replacement, pos[0]);
}
return 0;
}
It should work.
|
Yes well you can remove the 2 indeed,
not sure why you had to copy this and add the onplayertext code with it, but whatever.