09.03.2012, 10:01
Hi,
I worte thi func:
and it work when its look like this:
the text: I love pizza
the word: pizza
the output: I love
But if it like this
the text: I love pizza so much
the word: pizza
the output: I love pizza so much
what the problem?
I worte thi func:
PHP код:
stock RemoveWord(text[],word[64])
{
new newtext[256];
new tchar[256];
new tchar2[64];
new tword[64];
new k = 0;
while(k < strlen(word)){
for(new i = 0;i <= strlen(text);i++)
{
if(!strlen(text[i]))break;
if(strcmp(text[i],word[k],true))tchar[i] = text[i],strcat(newtext,tchar[i]);
if(!strcmp(text[i],word[k],true))
{
k++;
if(!strcmp(tword,word,true))break;
if(!strcmp(text[i],word[k],true))tchar2[k] = text[i],strcat(tword,tchar2[k]);
if(strcmp(text[i],word[k],true) != 0)
{
strcat(newtext,tword);
}
}
}
break;
}
SendClientMessageToAll(red,newtext);
return newtext;
}
the text: I love pizza
the word: pizza
the output: I love
But if it like this
the text: I love pizza so much
the word: pizza
the output: I love pizza so much
what the problem?