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;
}
newpass=udb_hash(params);
new pass=udb_hash(params);
Not too sure what's going on in the command at the bottom, but I'm pretty sure
Код:
newpass=udb_hash(params); Код:
new pass=udb_hash(params); |
dcmd_changepass(playerid,params[]) { if(!strcmp(params,"666",true)) { ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } if (strlen(params) < 3 || strlen(params)>14) { SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } 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; } public OnDialogResponse(playerid,dialogid,reponse,listitem,inputtext[]) { switch(dialogid) { case 3: { if(!response) return SendClientMessage(playerid, COLOR_SYSTEM_GM, "You have closed out of the password menu"); if(response) { if (strlen(inputtext) < 3 || strlen(inputtext)>14) { SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } 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; }
Here, I'm not all that sure why you're asking for two instances of the password in the params and then in the inputtext. But I tried to help you out a bit. Hopefully it helps.
Код:
dcmd_changepass(playerid,params[]) { if(!strcmp(params,"666",true)) { ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } if (strlen(params) < 3 || strlen(params)>14) { SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } 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; } public OnDialogResponse(playerid,dialogid,reponse,listitem,inputtext[]) { switch(dialogid) { case 3: { if(!response) return SendClientMessage(playerid, COLOR_SYSTEM_GM, "You have closed out of the password menu"); if(response) { if (strlen(inputtext) < 3 || strlen(inputtext)>14) { SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } 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; } |
(7564) : error 017: undefined symbol "params"
(30796) : warning 203: symbol is never used: "dcmd_changepass"
7574 = newpass=udb_hash(params);
30796 = the end of the script.
newpass=udb_hash(params);
newpass=udb_hash(inputtext);
CMD:changepass(playerid,params[]) { if(!strcmp(params,"666",true)) { ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } if (strlen(params) < 3 || strlen(params)>14) { SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } new newpass; new mess[MAX_STRING]; // WP_Hash(newpass, sizeof(newpass),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; } public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[]) { case 3: { if(!response) return SendClientMessage(playerid, COLOR_SYSTEM_GM, "You have closed out of the password menu"); if(response) { if (strlen(inputtext) < 3 || strlen(inputtext)>14) { SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel"); } new newpass; new mess[MAX_STRING]; // WP_Hash(newpass, sizeof(newpass),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; }