new ChangePass[MAX_PLAYERS];
CMD:changepass(playerid, params[])
{
if(ChangePass[playerid] == 0)
{
ShowPlayerDialog(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_PASSWORD, "Change Password", ""white"Please type your new "red"password "white"below", "Change","Cancel");
ChangePass[playerid] = 1;
}
else return SendClientMessage(playerid, COLOR_RED, "You can only change password once at a time");
return 1;
}
//OnDialogResponse
if(dialogid == DIALOG_CHANGEPASS)
{
new name[MAX_PLAYER_NAME],file[256],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVERFILE, name);
if(!response) return GameTextForPlayer(playerid,"~r~Changing Password Canceled...", 1500, 3);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_PASSWORD,""red"Changing Password Failed",""red"You put a empty pass in the blank\n"green"Please make sure you field the blank\nwith your new password","Change","Cancel");
format(string, 128, "You succesfully change your password, your new password is %s",inputtext);
SendClientMessage(playerid, COLOR_GREEN, string);
dini_IntSet(file, "Password", udb_hash(inputtext));
}
i will put it inside the Changepassword - OnDialogResponse?
|
if(dialogid == DIALOG_CHANGEPASS)
{
new name[MAX_PLAYER_NAME],file[256],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVERFILE, name);
if(!response) return GameTextForPlayer(playerid,"~r~Changing Password Canceled...", 1500, 3);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_PASSWORD,""red"Changing Password Failed",""red"You put a empty pass in the blank\n"green"Please make sure you field the blank\nwith your new password","Change","Cancel");
if(inputtext == dini_Int(file,"Password")) return SendClientMessage(playerid,red,"You cannot keep the same password again!");
format(string, 128, "You succesfully change your password, your new password is %s",inputtext);
SendClientMessage(playerid, COLOR_GREEN, string);
dini_IntSet(file, "Password", udb_hash(inputtext));
}
Please also help me with my gamemode. my gamemode don't read the include anymore i got the "cannot read from file "blahblahblah" i'm sure i have all includes. the includes are working last time ago.
|