21.08.2018, 01:48
(
Последний раз редактировалось ServerFiles; 21.08.2018 в 03:33.
)
my change pass not working, they still need to login using their old password.
PHP код:
dcmd_changepass(playerid,params[])
{
if(!strcmp(params,"666",true))
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel");
return 1;
}
if (strlen(params) < 3)
{
SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password is too short");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel");
return 1;
}
if(strlen(params)>17)
{
SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password is too long");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel");
return 1;
}
new hashed[129], sQuery[528];
WP_Hash(hashed, 129, params);
mysql_format(sqldb, sQuery, sizeof sQuery, "UPDATE `PlayerInfo` SET `Password` = '%e' WHERE `PlayerName` = '%e'", hashed, PlayerName(playerid));
SendClientMessage(playerid,COLOR_SYSTEM_GM,"..: SUCCESS: Your password has been changed. :..");
return 1;
}