Checking if it old/exist password
#1

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

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));
    }
+Rep for the one who will help me
Reply
#2

It should be an if(udb_hash(inputtext) == dini_Int(file,"Password")) // OldPassword can be the string you were using for password. It should be edited!
Reply
#3

i will put it inside the Changepassword - OnDialogResponse?
Reply
#4

Quote:
Originally Posted by [SP]Mr.Kakashi[WP]
Посмотреть сообщение
i will put it inside the Changepassword - OnDialogResponse?

pawn Код:
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));
    }
[Untested]
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by [SP]Mr.Kakashi[WP]
Посмотреть сообщение
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.
Even i've got that thing lot of time's! Maybe its due to corruption in the Windows! or something else! Even i had all the necessary include's but still had that error on Compilation. What i did was Format my Windows lol.

Idk what you should do! I hope someone has a better alternative!
Reply
#7

now i had 2 problems how could i test the code if my gamemode .amx is missing because of the error
Reply
#8

Problem fix i copy the folder Pawno into my other server script thats why i get error i replace it now i don't have error by the way i will check if its working
Reply
#9

Thanks it worked +Rep for you
Reply
#10

EDIT: Worked! Thread Resolved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)