12.09.2016, 14:06
Hello, I've made a dialog to change the account's password, I type /changepw, then a dialog shows up, I write the password and it says in chat "changed pw to..", but it's not changed on the database. I've tried to fix it many times, but no chance :C help please.
PHP код:
case DIALOG_CHANGEPW:
{
if(response)
{
if(pInfo[playerid][LoggedIn] == 1)
{
if(isnull(inputtext)) return ShowPlayerDialog(playerid, DIALOG_CHANGEPW, DIALOG_STYLE_INPUT, ""COL_WHITE"Changing Password", ""COL_WHITE"Write the new password. Do not forget it!\n\n"COL_RED"Your password must be at least 5 characters!", "Done", "Close");
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_CHANGEPW, DIALOG_STYLE_INPUT, ""COL_WHITE"Changing Password", ""COL_WHITE"Write the new password. Do not forget it!\n\n"COL_RED"Your password must be at least 5 characters!", "Done", "Close");
new string[128], hash[129], query[200];
WP_Hash(hash, sizeof(hash), inputtext);
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Password` = %e WHERE `ID` = %d", hash, pInfo[playerid][ID]);
mysql_tquery(mysql, query, "");
format(string, sizeof(string), "You have successfully changed your password to %s. Don't forget it!", inputtext);
NGMSG(playerid, string);
}
}
}