SA-MP Forums Archive
strfind - 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: strfind (/showthread.php?tid=87444)



strfind - UsaBoy91 - 20.07.2009

pawn Код:
new name[24];
GetPlayerName(playerid,name,sizeof name);
if(strfind(name,"Jacket",true) != -1)
{
   SendClientMessage(playerid,0xFFFFCCFF,"Welcome back Boss.");
}
Ok , but if my name is Jacketx , i recive this message too why ?

All names started with Jacket recive that message, why?


Re: strfind - M4S7ERMIND - 20.07.2009

use strcmp


Re: strfind - Pawno_Master - 20.07.2009

Maybe because jacket starts with the names
uhh

maybe you can use an
{
else
}
??



Re: strfind - UsaBoy91 - 20.07.2009

Quote:
Originally Posted by Μαστερμινδ
use strcmp
oh yea


Re: strfind - MadeMan - 20.07.2009

strfind finds a string from another string so if you have dthdhJacketsgrgrs it also sends true


Re: strfind - James_Alex - 20.07.2009

i think you have to change the strfind by strcmp
cuz strfind will check the player name
if there is Ja... it send the message