Login problem
#1

Hello,
When i register and try login again its login fine, and if the password they say " invalid password "
but after sometime i try to login with any password i can login normal.
can anyone help me please?
here is a code i hope can help ya
pawn Код:
else if(dialogid == 2) // Login
    {
        if(response)
        {
            new file[64], password[256], IP[16], password2[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            WP_Hash(password2, sizeof(password2), inputtext);
            format(password, sizeof(password), "%s", dini_Get(file, "Password"));
            if(strcmp(password, inputtext,true) && strcmp(password, password2, true))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
                ShowDialog(playerid, 2);
                return 1;
            }
Reply
#2

you don't need two compares, just use a one , the >correct< one:
pawn Код:
if(strcmp(password2, password, false) == 0)
{
       /* Successfully logged in */
}
else
{
      /* incorrect password */
}
return 1;
}
Reply
#3

You don't need this part:
pawn Код:
strcmp(password, inputtext,true)
Reply
#4

Anyone give me a code..
Reply
#5

pawn Код:
else if(dialogid == 2) // Login
    {
        if(response)
        {
            new file[64], password[256], IP[16], password2[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            WP_Hash(password2, sizeof(password2), inputtext);
            format(password, sizeof(password), "%s", dini_Get(file, "Password"));
            if(strcmp(password2, password, false) == 0)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
                ShowDialog(playerid, 2);
                return 1;
            }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)