30.08.2011, 14:45
Oh, I'm sorry.
In your case (inputtext length is not defined, hence not the same as the length of the password string), you can use format/strcat/strmid and possibly some more functions. I assume using format would be a simple solution but as far as I know, not as efficient as using strmid in this case.
Comparing strings in PAWN doesn't work as:
You'll need to use the strcmp function (https://sampwiki.blast.hk/wiki/Strcmp):
Note that the false as the 3rd parameter also checks the input case.
In your case (inputtext length is not defined, hence not the same as the length of the password string), you can use format/strcat/strmid and possibly some more functions. I assume using format would be a simple solution but as far as I know, not as efficient as using strmid in this case.
pawn Код:
strmid(Password[playerid], inputtext, 0, strlen(inputtext));
pawn Код:
if(string1 == string2)
pawn Код:
if(!strcmp(Password[playerid], inputtext, false))