Y_INI Help ( login bug ) +rep
#1

Guys good day
i have problem with my login system
i have typed the correct password but still it will say error please i need help
here is the code

pawn Код:
case D_LOGIN:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(udb_hash(inputtext) == pData[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, pData[playerid][pMoney]);
                    SendClientMessage(playerid,C_BOT,"iBot:"CWHITE" You have successfully login the server");
                }
                else
                {
                    new name[MAX_PLAYER_NAME],bstring[500];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(bstring,500,""CWHITE"User Name: %s \n\n"CRED"Your password is Error please enter the password correctly"CWHITE" \n\nPlease enter your password bellow to Login.",name);
                    ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,""CRED"Please Enter your password",bstring,"Login","Quit");
                }
                return 1;
            }
        }
    }
pawn Код:
new INI:Data = INI_Open(UserPath(playerid));
                INI_SetTag(Data,"file");
                INI_WriteInt(Data,"Password",udb_hash(inputtext));
                INI_WriteInt(Data,"Money",0);
                INI_WriteInt(Data,"Admin",0);
                INI_Close(Data);
pawn Код:
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Guys i need help thanks +rep
Reply
#2

Guys anyone please?
Reply
#3

Post where you save your stats. I had a problem like this before.
Reply
#4

pawn Код:
/RicaNiel/PlayerData/%s.ini
here is it

I define it as PATH

please anyone
Reply
#5

post your code not your path
Reply
#6

How are you loading your passwords?
How are you saving them when they register?
Reply
#7

dffg
Reply
#8

anyone?
Reply
#9

Man, stop bumping after every 10 minutes! If I would have done this, I would have been banned...
Reply
#10

Post the code where you are saving your stats, don't be so ignorant and bump every 10 minutes when we've already told you what to post.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)