SA-MP Forums Archive
Requesting help regarding SQL hash - 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: Requesting help regarding SQL hash (/showthread.php?tid=367142)



Requesting help regarding SQL hash - milanosie - 08.08.2012

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?

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



Re: Requesting help regarding SQL hash - milanosie - 08.08.2012

FIXED