Forbidden Words
#1

Hey I want the code which i can add to my GM
When player say fuck it will be converted to someother text
Exampe
Player : Shit Server
Change to : I love this server
Reply
#2

I did an example for you .

It will change the word "tool" in the player's text to the word "best".

Look to the comments

pawn Код:
public OnPlayerText(playerid, text[])
{
    for(new x = 0; x <= strlen(text); ++x)
    {
        if(text[(x)]=='t' && text[(x+1)]=='o' && text[(x+2)]=='o' && text[(x+3)]=='l') //Look that "if" checks if the character is part of the word that you choose, and if it is really the word.
        {
            text[(x)] = 'b';
            text[(x+1)] = 'e';
            text[(x+2)] = 's';
            text[(x+3)] = 't';  //It will change "tool" for "best"
        }
    }
    return 1;
}
There are another maneers to do this too.

I hope that i have helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)