08.07.2017, 02:47
Help with this!
pawn Код:
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)>14)
{
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 newpass;
new mess[MAX_STRING];
newpass=udb_hash(params);
dUserSetINT(PlayerName(playerid)).("password_hash",newpass);
format(mess,sizeof(mess),"..: SUCCESS: Your password has been changed. :..",newpass);
SendClientMessage(playerid,COLOR_SYSTEM_GM,mess);
return 1;
}