05.04.2017, 15:13
PHP код:
case DIALOG_CHANGEPS2:
{
if(response)
{
if(!strlen(inputtext)) // if nothing is entered in the dialog
{
SendClientMessage(playerid, RED, "You must enter a password.");
}
new string[128];
new hashpass[129]; // the whirlpool uses a 129 length string for hashing the password.
WP_Hash(hashpass, sizeof(hashpass), inputtext); // to hash the input data
format(string, sizeof(string), "Your password is: %s", inputtext); // we have formatted a string to include variables inside it
SendClientMessage(playerid, -1, string); // sending the above string message
new query[256];
WP_Hash(pData[playerid][Password], 129, inputtext); //hashing inputtext
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `Password`=%s WHERE `Username`='%s'",
pData[playerid][Password], Name[playerid]);
mysql_tquery(mysql, query, "", "");
return 1;
}
}