How to replace a word
#4

pawn Code:
new const BadWords[][] = {
    "shit",
    "fuck"
};

public OnPlayerText(playerid, text[])
{
    new placeholder;
    for(new i = 0; i < sizeof BadWords; i++)
    {
        placeholder = strfind(text, BadWords[i], true);
        if(placeholder != -1)
        {
            for(new x = placeholder; x < placeholder + strlen(BadWords[i]); x ++)
            {
                text[x] = '*';
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to replace a word - by Sascha - 16.08.2010, 17:31
Re: How to replace a word - by Slice - 16.08.2010, 17:34
Re: How to replace a word - by (.Aztec); - 16.08.2010, 17:44
Re: How to replace a word - by bigcomfycouch - 16.08.2010, 17:47
Re: How to replace a word - by Sascha - 16.08.2010, 17:50

Forum Jump:


Users browsing this thread: 2 Guest(s)