proble with function I worte
#1

Hi,
I worte thi func:
PHP код:
stock RemoveWord(text[],word[64])
{
    new 
newtext[256];
    new 
tchar[256];
    new 
tchar2[64];
    new 
tword[64];
    new 
0;
    while(
strlen(word)){
    for(new 
0;<= 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;

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?
Reply
#2

help?
Reply
#3

please help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)