inputtext problem - 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)
+--- Thread: inputtext problem (
/showthread.php?tid=491224)
inputtext problem -
gahal156 - 29.01.2014
Код:
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");
Re: inputtext problem -
Smileys - 29.01.2014
it's because you echo the hashed one, lol.
Re: inputtext problem -
gahal156 - 29.01.2014
I printed the normal one and the hashed one :/
inputtext, pword
Don't you check before?
Re: inputtext problem -
gahal156 - 30.01.2014
Help please, will give +rep
Re: inputtext problem -
Smileys - 30.01.2014
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.
Re: inputtext problem -
Threshold - 30.01.2014
Show your Hash function, I'm assuming that it's overwriting it.
or something similar?