Login problem
#1

Hello,
i have a problem with registering/logging system.
the problem is when i register i can't login with the password that i created, but every password works ( i can login with every password exept the password that i created )
Example: i register password "123123", and i try to login with "123123" its won't work, but if i tried to login with "asdrqwewq" it works.
i hope i explained good, here is a code that can help:
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
#2

you can do something like:
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, true))//IF THE PLAYER DID RIGHT PASSWORD
            {
            //CODE IF PASS IS RIGHT
            }
            else
            {
            SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
            ShowDialog(playerid, 2);
            return 1;
            }
Reply
#3

It's giving me 26 errors...
Reply
#4

waoh? did you forgot a closing bracket?
Reply
#5

i didn't add anything, just copied
Reply
#6

try to make that system load user password from ini file..
set file location i think thats is fix
Reply
#7

You have missed a closing brace "{" or "}", try to find where you did the mistake and do a fix.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)