Not logging me in?
#1

pawn Code:
if(dialogid == DIALOG_LOGIN)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            new hinfo[20];
            if(PlayerInfo[playerid][pHouseKey] == -1)
            { hinfo = "Unavailable"; }
            else if(PlayerInfo[playerid][pHouseKey] >= -1)
            { hinfo = "Available"; }
            if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
            {
                TogglePlayerSpectating(playerid, 0);
                INI_ParseFile(UserSavePath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                SendClientMessage(playerid, COLOR_LIGHTRED, "You have entered your password correct! Logged in successfully.");
                SpawnPlayer(playerid);
                SetPlayerStuff(playerid);
                SetPlayerPos(playerid, PlayerInfo[playerid][PlayerPos][0], PlayerInfo[playerid][PlayerPos][1], PlayerInfo[playerid][PlayerPos][2]);
                gLoggedIn[playerid] = 1000;
            }
            else ShowPlayerDialog(playerid, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, "{DE0D0D}Error!", "{EDC72F}You have entered an invalid password.\n\n{CF0808}You have been kicked.", "Close", "");
            //Kick(playerid);
        }
    }
Thats my login code, but for some reason its being a fucking shit-head(sorry for rage).

No-matter what it ALWAYS say its invalid, when it clearly isn't, i've registered shit load of different accs to test it and its generally being a *****..
My register dialog with the PW saving:
pawn Code:
if(dialogid == DIALOG_REGISTER)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            if(udb_hash(inputtext) > 5)
            {
                new genderstring[96];
                TutorialPassword[playerid] = udb_hash(inputtext);
                gLoggedIn[playerid] = 5;
                format(genderstring, sizeof(genderstring), "%s, choose your gender!", GetPlayerNameEx(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTERGENDER, DIALOG_STYLE_LIST, genderstring, "I am a male!\nI am a female!", "Select", "Cancel");
            }
        }
    }
Then at the end of the tut it turns the TutorialPassword into a INI_WriteInt
pawn Code:
INI_WriteInt(File, "Password", TutorialPassword[playerid]);
Any help:/
Reply
#2

pawn Code:
if(fexist(UserSavePath(playerid)))
    {
        INI_ParseFile(UserSavePath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        format(string, sizeof(string), "/Users/%s.ini", PlayerName);
        format(string1, sizeof(string1), "Hello %s, welcome back!", GetPlayerNameEx(playerid));
        format(string2, sizeof(string2), "Welcome back %s, to "GM_NAME"! We have found your account registered in the database.\n\nEnter your password to login!", GetPlayerNameEx(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string1, string2, "Login!", "Cancel");
    }
(OnPlayerConnect)
Its loading it here, although it just wont, ugh getting so frustrated with this
Reply
#3

How would I do it? Where? This has really confused me
Reply
#4

Anyone?
Reply
#5

instead of
pawn Code:
if(fexist(UserSavePath(playerid)))
    {
        INI_ParseFile(UserSavePath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        format(string, sizeof(string), "/Users/%s.ini", PlayerName);
        format(string1, sizeof(string1), "Hello %s, welcome back!", GetPlayerNameEx(playerid));
        format(string2, sizeof(string2), "Welcome back %s, to "GM_NAME"! We have found your account registered in the database.\n\nEnter your password to login!", GetPlayerNameEx(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string1, string2, "Login!", "Cancel");
    }

USE


pawn Code:
if(fexist(UserSavePath(playerid)))
    {
        INI_ParseFile(UserSavePath(playerid), "LoadUser_user", .bExtra = true, .extra = playerid);//or what ever u have like LoadUser_User or the LoadUser_Account
        format(string, sizeof(string), "/Users/%s.ini", PlayerName);
        format(string1, sizeof(string1), "Hello %s, welcome back!", GetPlayerNameEx(playerid));
        format(string2, sizeof(string2), "Welcome back %s, to "GM_NAME"! We have found your account registered in the database.\n\nEnter your password to login!", GetPlayerNameEx(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string1, string2, "Login!", "Cancel");
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)