using strfind- but CAPS Bug is a problem! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: using strfind- but CAPS Bug is a problem! (
/showthread.php?tid=82428)
using strfind- but CAPS Bug is a problem! -
Tenshi - 18.06.2009
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;
}
}
Re: using strfind- but CAPS Bug is a problem! -
BMUK - 18.06.2009
https://sampwiki.blast.hk/wiki/Scripting...ns_Old#strfind
particularly:
ignorecase=false Ignore capitals if true.
Re: using strfind- but CAPS Bug is a problem! -
Tenshi - 18.06.2009
sorry but i cannot understand wiki like that without example
Re: using strfind- but CAPS Bug is a problem! -
BMUK - 18.06.2009
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
Re: using strfind- but CAPS Bug is a problem! -
PoWerZ - 18.06.2009
Jew is a curse for you?
Re: using strfind- but CAPS Bug is a problem! -
OmeRinG - 18.06.2009
Why is jew a curse? stupid nazi.
Re: using strfind- but CAPS Bug is a problem! -
Tenshi - 19.06.2009
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!