dialog bugs../login
#1

this doesnt log me in-.- it gets my pass right and everything but i have to do /login pass after to actually log me in

pawn Код:
if(dialogid == 1) //Logging
    {
        if(!response)
        {
            SendClientMessage(playerid,COLOR_RED,"You Have To Login In Order To Play!");
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
        }
        if(response)
        {
            new ppw[256];
            ppw = dini_Get(pfile, "Password");
            if(strcmp(ppw, inputtext, true))
            {
                SendClientMessage(playerid,COLOR_RED,"Wrong Password");
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
            }
            else
            {
                IsLogged[playerid] = 1;
                LoadPlayer(playerid);
                SetTimerEx("TimePlayerLogged", 1000, true, "i", playerid);
                GameTextForPlayer(playerid,"~g~Logged In",2000,1);
            }
        }
        return 1;
    }
Reply
#2

try maybe
pawn Код:
if(strcmp(ppw, inputtext, true) != 0)
but "Password" isnt integer?
Reply
#3

also it works fine.. i dont think i need that above just the else part isnt working i think
password is anything. string/integer

it says i logged in but it doesnt actually logg me in

also my login cmd if it helps

pawn Код:
CMD:login(playerid, params[])
{
    new ppw[20], str[128];

    format(pfile, sizeof(pfile), pfile_path, Playername(playerid));

    if(sscanf(params, "s", ppw)) return SendMsg(playerid, RED, "*USAGE: /register [password] - Max length is 20 & minium is 3");
    if(strlen(ppw) <= 3) return SendMsg(playerid, RED, "*Error: Password Is Under The Limit Sorry");
    if(strlen(ppw) >= 19) return SendMsg(playerid, RED, "*Error: Password Is Over The Limit Sorry");
    if(IsLogged[playerid] == 1) return SendMsg(playerid, RED, "*Error: |- You Are Already Logged In -|");
    if(!dini_Exists(pfile)) return SendMsg(playerid, RED, "*Error: No account with that username is registered, please register");

    if(strcmp(dini_Get(pfile, "Password"), ppw, true) != 0) return SendMsg(playerid, RED, "*Error: Wrong Password. Password Did Not Match With The One You Have Register With.");
    format(str, sizeof(str), "*Success: You have Successfully Logged In %s", Playername(playerid), dini_Int(pfile, "AdminLevel"));
    SendMsg(playerid, LIME, str);
    LoadPlayer(playerid);
    IsLogged[playerid] = 1;
    SetTimerEx("TimePlayerLogged", 1000, true, "i", playerid);

    Invited[playerid] = -1;
    InHouse[playerid] = -1;
    House[playerid] = -1;
    new Pname[24], File[65]; GetPlayerName(playerid, Pname, 24);
    for(new V=0; V<HouseCount + 1; V++)
    {
        if(!strcmp(HouseInfo[V][HouseOwner], Pname, true))
        {
            House[playerid] = V;
            break;
        }
    }
    if(dini_Exists(File))
    {
        for(new K=0; K<HouseCount + 1; K++)
        {
            format(File, sizeof(File), "HouseKeys/%s.ini", HouseInfo[K][HouseNames]);
            if(dini_Int(File, Pname) == 1) Keys[playerid][K] = 1;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)