08.08.2012, 21:25
Alright, I don't know what I'm doing wrong here but it keeps telling me I got the wrong password while I obviously have the right one.
The password is saved correctly since I compared it to my old .ini file which also uses UDB_HASH, so what am I doing wrong?
The password is saved correctly since I compared it to my old .ini file which also uses UDB_HASH, so what am I doing wrong?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dialog_login)
{
if(!response) return Kick(playerid);
new query[200]; //
format(query, sizeof(query), "SELECT * FROM playerdata WHERE UserName = '%s' AND Password = %i", GetPlayerNameEx(playerid), udb_hash(inputtext));
mysql_store_result();
mysql_function_query(ServerInfo[MySQL], query, false, "LOGIN_SQL", "i", playerid);
new fields, rows;
cache_get_data(rows, fields);
if(rows)
{
SetTimerEx("prelog", 100, false, "i", playerid);
}
else
{
ShowPlayerDialog(playerid, dialog_login, DIALOG_STYLE_PASSWORD, "{1E3CE6}Character Login","{33A369}Incorrect password, please insert your password.","Login", "Exit");
}
mysql_free_result();
}
if(dialogid == dialog_register)
{
//blablabla