SA-MP Forums Archive
strcmp dont work - 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: strcmp dont work (/showthread.php?tid=163203)



strcmp dont work - Jony_King - 26.07.2010

If I compare two strings, it doesn't work.

pawn Код:
if(strcmp(PlayerInfo[playerid][pBankPinCode],inputtext, true ) == 0 )
Everything I type in, will accepted.
I Just want to comapre the PIN-Code with the inputtext.


Re: strcmp dont work - Conroy - 26.07.2010

pawn Код:
if(!strcmp(String1, String2)) {
/*If they are the same*/
}

if(strcmp(String1, String2) == -1) {
/*If they are not the same*/
}



Re: strcmp dont work - Jony_King - 26.07.2010

dont work

pawn Код:
if(!strcmp(PlayerInfo[playerid][pBankPinCode],inputtext))
        {
            format(string, sizeof(string), "Einzahlung \nAuszahlung \nKontostand");
            ShowPlayerDialog(playerid, 105, DIALOG_STYLE_LIST, "Bank", string, "Auswдhlen", "Abbrechen");
            return 1;
        }



Re: strcmp dont work - Dodus - 26.07.2010

It can't be:

Код:
if(PlayerInfo[playerid][pBankPinCode] == strval(inputtext))
?


Re: strcmp dont work - Jony_King - 26.07.2010

Yes, i tried it myself out, works but thanks for help


Re: strcmp dont work - Conroy - 26.07.2010

Quote:
Originally Posted by Jony_King
Посмотреть сообщение
dont work
They do work, you were just trying to put integers into it.