inputtext problem
#1

Код:
	        if(response)
	        {
		        new uFile[35];
			    format(uFile, 35, "users/%s.ini", PlayerName(playerid));
			    new INI:playerFile = INI_Open(uFile);
			    new pword[128];
				format(pword, sizeof(pword), "%s", Hash(inputtext));
			    INI_WriteString(playerFile, "Password", pword);
			    new string[256];
			    format(string, sizeof(string), "Your password is: %s, your hash password is: %s", inputtext, pword);
			    SCM(playerid,COLOR_GREEN,string);
				//ShowPlayerDialog(playerid,
				INI_Close(playerFile);
			}
	    }
The result is just wrong...
For example:
When I enter the password: "123456".
This is the result:
Код:
"Your password is: 1424QT(very wierd), your hash password is: Doesn't mater..."
And this is the dialog line:
Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Register", "Please enter a password in order to register to the server.", "Register", "Cancel");
Reply
#2

it's because you echo the hashed one, lol.
Reply
#3

I printed the normal one and the hashed one :/
inputtext, pword

Don't you check before?
Reply
#4

Help please, will give +rep
Reply
#5

you don't have to format it into another variable.

pawn Код:
if(response)
            {
                new uFile[35];
                format(uFile, 35, "users/%s.ini", PlayerName(playerid));
                new INI:playerFile = INI_Open(uFile);
                INI_WriteString(playerFile, "Password", pword);
                new string[256];
                format(string, sizeof(string), "Your password is: %s, your hash password is: %s", inputtext, Hash( inputtext ) );
                SCM(playerid,COLOR_GREEN,string);
                //ShowPlayerDialog(playerid,
                INI_Close(playerFile);
            }
        }
try that.
Reply
#6

Show your Hash function, I'm assuming that it's overwriting it.
pawn Код:
Hash(&text[])
{
    //...
or something similar?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)