Dialog issues
#1

I'm using Y_INI, when I type the wrong password to my account it still logs me in.
I've tried every solution but nothing seems to work, I'm using whirlpool
I also tried if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))

All I want it to do is, if you insert the wrong password the dialog will popup again saying you've entered the wrong password.

pawn Код:
case DIALOG_LOGIN:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                new hashpass[129];
                WP_Hash(hashpass,sizeof(hashpass),inputtext);
                if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SendClientMessage(playerid,COLOR_WHITE,"{8EC7DC}[INFO] {FFFFFF}Your statistics have been restored!");
                }
                else
                {
                    format(string, sizeof(string), "Before playing you must login\n\nUsername: %s\n\nEnter your password below and click login",PlayerName(playerid));
                    ShowPlayerDialog(playerid,DIALOG_LOGIN,3,"{EDDC57}Login required",string,"Login","Cancel");
                    CheckPasswordAttempts(playerid);
                }
                return 1;
            }
        }
Reply
#2

Most of the time it's because you're loading the password as an integer instead of a string.

Show us the loading part if you don't understand.
Reply
#3

What would 'loading part' be
Reply
#4

maybe
pawn Код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
change to
pawn Код:
if(!strcmp(hashpass, pInfo[playerid][pPass], false))
Reply
#5

Quote:
Originally Posted by Giroud12
Посмотреть сообщение
maybe
pawn Код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
change to
pawn Код:
if(!strcmp(hashpass, pInfo[playerid][pPass], false))
Naw, I use PlayerInfo


Anyway here's what it's loading..

pawn Код:
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Bank_Cash",PlayerInfo[playerid][pBankCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Rob_Skill",PlayerInfo[playerid][pRobSkill]);
    INI_Int("Terrorism_Skill",PlayerInfo[playerid][pTerrorism]);
    INI_Int("Rape_Skill",PlayerInfo[playerid][pRapeSkill]);
    INI_Int("Mechanic_Skill",PlayerInfo[playerid][pMechSkill]);
    INI_Int("Arrests_Made",PlayerInfo[playerid][pArrestsMade]);
    INI_Int("Wanted_Level",PlayerInfo[playerid][pWanted]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);

    return 1;
}
Reply
#6

lol change to
pawn Код:
if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))
Reply
#7

Try changing
pawn Код:
INI_Int("Password",PlayerInfo[playerid][pPass]);
to
pawn Код:
INI_String("Password", PlayerInfo[playerid][pPass]);
Quote:
Originally Posted by Giroud12
Посмотреть сообщение
lol change to
pawn Код:
if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))
If you read the third line of his first post, he already tried that.
Reply
#8

Maybe this will help you :
1) https://sampforum.blast.hk/showthread.php?tid=442588
2) https://sampforum.blast.hk/showthread.php?tid=352703
Reply
#9

Quote:
Originally Posted by Giroud12
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=352703

That tutorial helped me fix it, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)