Replace a word in chat
#9

Quote:
Originally Posted by ricardo178
View Post
pawn Code:
public OnPlayerText(playerid, text[])
{
    #define STRING_TO_FOUND     "hi"
    #define STRING_TO_ADD       "hello"
    new text[128] = "hi, whats up? im here for u";
    if(strfind(text, STRING_TO_FOUND, true) != -1) {
        new pos = strfind(text, STRING_TO_FOUND, true);
        new length = strlen(STRING_TO_FOUND);
        strdel(text, pos, length);
        strins(text, STRING_TO_ADD, pos, length);
    }
    print(text);
}
Someone with a scripting level over 9000 should know how to do this...
Thats the wrong way to do it, I know how to copy and paste.
Reply


Messages In This Thread
Replace a word in chat - by [NWA]Hannes - 09.06.2012, 18:30
Re: Replace a word in chat - by ryansheilds - 09.06.2012, 19:01
Re: Replace a word in chat - by [NWA]Hannes - 09.06.2012, 19:05
Re: Replace a word in chat - by ryansheilds - 09.06.2012, 19:14
Re: Replace a word in chat - by ReVo_ - 09.06.2012, 19:38
Re: Replace a word in chat - by Mauzen - 09.06.2012, 20:06
Re: Replace a word in chat - by [NWA]Hannes - 09.06.2012, 20:35
Re : Re: Replace a word in chat - by ricardo178 - 09.06.2012, 20:39
Re: Re : Re: Replace a word in chat - by [NWA]Hannes - 09.06.2012, 21:02

Forum Jump:


Users browsing this thread: 1 Guest(s)