OnPlayerText (HELP PLEASE)
#1

i want to make a script so if someone says a bad word in a sentence it changes it to "****"
so if a person says "hello all you fuckers" it changes it to "hello all you *******"
how can i do this?
Reply
#2

Код:
new BadWords[][] = {
	"shit",
	"fuck"
	//etc.
};
in onplayertext

Код:
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] = '*';
		}
	}
}
untested
Reply
#3

thanks works well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)