if(strfind problem
#1

Hello so my problem here. The if function is not working correctly it always bypasses:
PHP код:
//The " Tag " here
        
new Tag[6] = "[EX]"
    
new pn[24]; GetPlayerName(playeridpn24);
    if(
strfind(pnTagtrue) != 1)
    {
        }
        else 
SCM(playerid, -1"Whatever"); 
if my name doesn't contain [EX] it should say Whatever, but it continues in the things nested in if

P.S I don't know why the identication is not working in my browser
Reply
#2

https://sampwiki.blast.hk/wiki/Strfind

Quote:

Return Values:
The number of characters before the sub string (the sub string's start position) or -1 if it's not found.

Код:
  if(strfind(pn, Tag, true) != -1)
Yeah, sometimes the identication does not work.
Reply
#3

PHP код:
if(strfind(pnTagtrue) != 1//When the strfind dosen't equals to not found
else //When the strfind returns something else 
OR what should I have to write?
Reply
#4

Quote:
Originally Posted by coool
Посмотреть сообщение
PHP код:
if(strfind(pnTagtrue) != 1//When the strfind dosen't equals to not found
else //When the strfind returns something else 
OR what should I have to write?
Nonononononono:

PHP код:
if(strfind(pnTagtrue) != -1// when strfind FOUND something NOTICE the -1 < minus one
else // when it's -1 , it did not find anything. 
Reply
#5

Thanks It Works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)