02.01.2012, 03:05
i was making my Roleplay server suddenly i didn't notice that i haven't made this checking system
yet. the question is how to check if player type an old password or exists password. i'm new
in dini scripting you know
+Rep for the one who will help me
yet. the question is how to check if player type an old password or exists password. i'm new
in dini scripting you know
pawn Код:
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));
}