Saving inputtext into variable.
#4

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.
pawn Код:
strmid(Password[playerid], inputtext, 0, strlen(inputtext));
Comparing strings in PAWN doesn't work as:
pawn Код:
if(string1 == string2)
You'll need to use the strcmp function (https://sampwiki.blast.hk/wiki/Strcmp):
pawn Код:
if(!strcmp(Password[playerid], inputtext, false))
Note that the false as the 3rd parameter also checks the input case.
Reply


Messages In This Thread
Saving inputtext into variable. - by Homerman - 30.08.2011, 14:25
Re: Saving inputtext into variable. - by AndreT - 30.08.2011, 14:30
Re: Saving inputtext into variable. - by Homerman - 30.08.2011, 14:31
Re: Saving inputtext into variable. - by AndreT - 30.08.2011, 14:45
Re: Saving inputtext into variable. - by Homerman - 30.08.2011, 14:57

Forum Jump:


Users browsing this thread: 2 Guest(s)