30.05.2014, 21:03
We have a login system, however, if we compare our real password, to the inputted password, it removes the first character of the real password, thus, making the inputted password seem incorrect.
Heres a screenshot:
PHP код:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new hpass[129];
WP_Hash(hpass, sizeof(hpass), inputtext);
if(!strmatch(pVariables[playerid][pPassword], hpass))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
else
{
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s' LIMIT 1", name1);
mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
}
new string[256], string1[256];
format(string, sizeof(string), "Real pass: %s", pVariables[playerid][pPassword]);
SendClientMessageToAll(-1, string);
format(string1, sizeof(string1), "Input Pass: %s", hpass);
SendClientMessageToAll(-1, string1);
return 1;
}
Heres a screenshot: