SA-MP Forums Archive
MySQL Password Change - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Password Change (/showthread.php?tid=235939)



MySQL Password Change - Unknown123 - 06.03.2011

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;
}



Re: MySQL Password Change - dice7 - 06.03.2011

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


Re: MySQL Password Change - Unknown123 - 06.03.2011

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

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