Saving inputtext!
#1

Hey, i am creating register system so..
I have one dialog that enters password then when entered it shows next dialog where that password is shown (for check) when i click "Done" in that second password in my .INI file password sould be created.

I did it on this way....
Код:
MyPassword[playerid] = strlen(inputtext);
dini_Set(path, "Lozinka", MyPassword[playerid]);
(Have in mind that i cant replace MyPassword[playerid] with inputtext cuz of 2 different dialog's)

But when i enter at my .INI it show's
Код:
Lozinka=
Reply
#2

I don't really understand, but..

check if the password is valid, not null etc and save it on the MyPassword[playerid] variable. Then on the second dialog, save it according to the variable above.

If I'm mistaken, then please correct me and explain me once again.
Reply
#3

I tryied MyPassword[playerid] = strlen(inputtext); but it return's blank :S!

So i have
Код:
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "INPUT PASSWORD", string, "Dalje", "Natrag");

if(dialogid == 3)
{
new string[256];
format(string, sizeof(string), "You entered password: %s is it correct?", inputtext);
MyPassword[playerid] = strlen(inputtext);
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX, "PASSWORD CHECK", string, "Done", "Natrag");
}

if(dialogid == 4)
{
dini_Set(path, "Lozinka", MyPassword[playerid]);
}
And when i open my file it shows this:
Reply
#4

strlen(inputtext) will count how many chars there are in the inputtext.

If MyPassword[playerid] is a string, then use:
pawn Код:
format(MyPassword[playerid], sizeof(MyPassword[playerid]), inputtext);
Reply
#5

That won't work. To get the size of the second dimension in an array you'd use
pawn Код:
sizeof(MyPassword[])
Reply
#6

Fixed with strmid
Thanks for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)