if(cache_num_rows())
{
format(string, sizeof(string), "{FFFFFF}Welcome back, {FF0000}%s{FFFFFF}!\n{FFFFFF}Please enter your password to continue.", GetName(playerid));
Dialog_Show(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{ADD8E6}Login", string, "Login", "Cancel");
}
Dialog:LOGIN(playerid, response, listitem, inputtext[])
{
printf("DEBUG: (DIALOG_LOGIN): PLAYERID: %d, RESPONSE: %d, LISTITEM: %d", playerid, response, listitem);
if(response)
{
new query[500], Password[BCRYPT_HASH_LENGTH];
mysql_format(Database, query, sizeof(query), "SELECT `Password` FROM `userdata` WHERE `User`='%e' LIMIT 1;", GetName(playerid));
new Cache:result = mysql_query(Database, query);
cache_get_value_name(0, "Password", Password, BCRYPT_HASH_LENGTH);
bcrypt_check(inputtext, Password, "OnPasswordChecked", "d", playerid);
cache_delete(result);
}
else
Kick(playerid);
return 1;
}
If you defined the dialog somewhere, delete the definition, also check if the dialog has the exact name always
|