15.03.2011, 03:18
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
There are another maneers to do this too.
I hope that i have helped

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;
}
I hope that i have helped
