Need help with changepass cmd (mysql,whirlpool)
#13

I've tried a few different methods, but still failing. This is where I am currently;
pawn Код:
CMD:changepass(playerid, params[])
{
    if (gPlayerInfo[playerid][pLogged] == 0)
        return SendClientMessage( playerid, -1, "You need to be logged in to use this. " );
    new inputtext[128];
    if(sscanf(params, "s[128]", inputtext))
        return SendClientMessage( playerid, -1, "USAGE: /changepass [New password]. " );
    if (strlen(params) > 90)
        return SendClientMessage(playerid, -1, "Password has to be between 1 and 90 characters.");
    new hash[129], Salt[30];
    randomString(Salt, SALT_LENGTH);
    format(hash, sizeof(hash), "%s%s", Salt, escape(inputtext));
    WP_Hash(hash, sizeof(hash), hash);
    ChangePass(playerid, hash, Salt);
    SendClientMessage(playerid, -1, "You have successfully changed your password.");
    return 1;
}
stock ChangePass(playerid, pass[129], salt[])
{
    new query[240];
    format(query, sizeof (query), "UPDATE `users` SET `pass` = '%s', `salt` = '%s' WHERE `id` = '%i'", pass, salt, gPlayerInfo[playerid][pID]);
    mysql_function_query(gHandle, query, false, "", "ssi");
    return 1;
}
So the server doesn't crash, but password and salt won't change. This is what happens;
Quote:

[22:32:16] [DEBUG] mysql_escape_string - source: "perkele", connection: 1, max_len: 512
[22:32:16] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `users` SET `pass` = 'AA5D3A8A33863DA55B957DD04370248BBE1", callback: "(null)", format: "ssi"
[22:32:16] [ERROR] mysql_tquery - callback parameter count does not match format specifier length

I've tried some other formats in mysql_function_query but always error.
Reply


Messages In This Thread
Need help with changepass cmd (mysql,whirlpool) - by Capua - 01.11.2014, 14:24
Re: Need help with changepass cmd (mysql,whirlpool) - by Stinged - 01.11.2014, 14:32
Respuesta: Need help with changepass cmd (mysql,whirlpool) - by Cerealguy - 01.11.2014, 14:40
Re: Respuesta: Need help with changepass cmd (mysql,whirlpool) - by Capua - 01.11.2014, 17:08
Re: Need help with changepass cmd (mysql,whirlpool) - by gtakillerIV - 01.11.2014, 17:48
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 01.11.2014, 18:53
Re: Need help with changepass cmd (mysql,whirlpool) - by gtakillerIV - 01.11.2014, 19:00
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 01.11.2014, 19:44
Re: Need help with changepass cmd (mysql,whirlpool) - by Stinged - 02.11.2014, 07:02
Re: Need help with changepass cmd (mysql,whirlpool) - by Stinged - 02.11.2014, 15:07
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 02.11.2014, 17:58
Re: Need help with changepass cmd (mysql,whirlpool) - by [HiC]TheKiller - 02.11.2014, 19:12
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 03.11.2014, 19:47
Re: Need help with changepass cmd (mysql,whirlpool) - by Runn3R - 03.11.2014, 20:13
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 03.11.2014, 20:22
Re: Need help with changepass cmd (mysql,whirlpool) - by [HiC]TheKiller - 03.11.2014, 22:49
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 09.11.2014, 14:56
Re: Need help with changepass cmd (mysql,whirlpool) - by Capua - 09.11.2014, 17:08

Forum Jump:


Users browsing this thread: 1 Guest(s)