using strfind- but CAPS Bug is a problem!
#1

ok first trying to prevent from words being used, seeing how this is very small
and usefull script, but lately i been getting buggers using CAPS like GAY, FAG,etc

how can i make it detect any word with or with out CAPS...
thanks in advanced <3

[partial coding but yea- SendErrMsg is a custom message function so ignore this, since it works fine.]
Код:
{ // Advanced String of block#2
		new gay = strfind(text,"gay");
		new fag = strfind(text,"fag");
		new jew = strfind(text,"jew");
		if(gay != -1 || fag != -1 || jew != -1)
		{
			SendErrMsg(playerid," You cannot use that word, it is not allowed in this server.");
			return 0;
		}

}
Reply
#2

https://sampwiki.blast.hk/wiki/Scripting...ns_Old#strfind

particularly: ignorecase=false Ignore capitals if true.
Reply
#3

sorry but i cannot understand wiki like that without example
Reply
#4

lol.. just change the strfind lines at the end. Like this:

pawn Код:
new gay = strfind(text,"gay",true);
new fag = strfind(text,"fag",true);
new jew = strfind(text,"jew",true);
See that I added ',true' which will check for CAPITALS now too
Reply
#5

Jew is a curse for you?
Reply
#6

Why is jew a curse? stupid nazi.
Reply
#7

Quote:
Originally Posted by OmeRinG
Why is jew a curse? stupid nazi.
i said " partial coding " meaning there is more words, just not added here to reduce spam text
shut up plz?

and thanks for example, i asked a question and i posted an answer that someone asked for, i think i balanced today's need for knowledge.

thanks guys!
Reply


Forum Jump:


Users browsing this thread: