Using strfind wrong?
#6

Quote:
Originally Posted by Wiki
Returns The number of characters before the sub string (the sub string's start position) or -1 if it's not found.
Use this:
pawn Код:
if(strfind(GetpName(playerid), "[iP]", false) != -1)
Basically what made it not work is it returned 0 as there are no characters before the [iP] when you made it check a name.
It should be set to false so it someone has the tag [ip] or [Ip] he won't be able to talk on the clan chat neither.

To even make this more accurate use the following:
pawn Код:
if(!strfind(GetpName(playerid), "[iP]", false))
This will make it ONLY work if the player has [iP] before his name, example: "[iP]iRage".
It won't work if a player has [iP] anywhere else in his name, example: "iRa[iP]ge" or "iRage[iP]".
Reply


Messages In This Thread
Using strfind wrong? - by JaKe Elite - 13.05.2012, 11:48
Re: Using strfind wrong? - by Libra_PL - 13.05.2012, 11:58
Re: Using strfind wrong? - by JaKe Elite - 13.05.2012, 12:02
Re: Using strfind wrong? - by Libra_PL - 13.05.2012, 12:11
AW: Using strfind wrong? - by Nero_3D - 13.05.2012, 12:19
Re: Using strfind wrong? - by iRage - 13.05.2012, 12:24
AW: Re: Using strfind wrong? - by Nero_3D - 13.05.2012, 12:38
Re: AW: Re: Using strfind wrong? - by iRage - 13.05.2012, 12:46
Re: Using strfind wrong? - by JaKe Elite - 14.05.2012, 00:49

Forum Jump:


Users browsing this thread: 1 Guest(s)