MySQL Password Change
#1

Why is this not working? It have no Errors/Warnings, it just dont change the password.
pawn Код:
dcmd_changepass(playerid, params[])
{
    new oldpass[128];
    new queue[313], WPhash[145], escape[145];
    if(sscanf(params, "s[128]s[128]", oldpass, WPhash)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /changepass (Old Password) (New Password)");
    //else if(oldpass == wrongpassword) return SendClientMessage(playerid, COLOR_ERROR, "Error: Wrong 'Old password'");
    {
        mysql_real_escape_string(oldpass, escape);
        WP_Hash(WPhash, sizeof(WPhash), escape);
        format(queue, sizeof(queue), "UPDATE `Players` SET `Password` = '%s' WHERE `Username` = '%s'", WPhash, PlayerIP(playerid));
        mysql_query(queue);
        SendClientMessage(playerid, COLOR_GREEN, "Password Changed!");
    }
    return 1;
}
Reply
#2

WHERE `Username` = '%s'", WPhash, PlayerIP(playerid));
Reply
#3

Thanks and.. How to make this, i just typed something..

pawn Код:
//else if(oldpass == wrongpassword) return SendClientMessage(playerid, COLOR_ERROR, "Error: Wrong 'Old password'");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)