y_ini login help [ +rep ]
#1

Guys my problem is it wont add the variable
of MAX_LOGIN_ATTEMPT
can anyone help me please

pawn Код:
case D_LOGIN:
        {
            if (!response ) return Kick (playerid);
            if(response)
            {
                if(udb_hash(inputtext) == pFiles[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SendClientMessage(playerid,C_WHITE,"You have succesfuly loggedin to server");
                }
                else
                {
                    new ldialog[500],lattemp[MAX_PLAYERS],try[128];
                    lattemp [playerid] += 1;
                    switch(lattemp[playerid])
                    {
                        case 1: try = "Three Loggedin Attempt Left ";
                        case 2: try = "Two Loggedin Attempt Left ";
                        case 3: try = "One Loggedin Attempt Left ";
                    }
                    if(lattemp[playerid] == 0)
                    {
                        format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
                        ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,""CSERVER"est",ldialog,"Login","Quit");
                    }
                    else if(lattemp[playerid] >= 1)
                    {
                        format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
                        ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,"Test",ldialog,"Login","Quit");
                    }
                    if(lattemp [playerid] == 4)
                    {
                        new string[128];
                        format(string,sizeof(string),""CORANGE"%s"CWHITE" has been kicked from the server ( "CRED"MAX LOGIN ATTEMPT"CWHITE" )");
                        SendClientMessageToAll(C_WHITE,string);
                    }
                }
                return 1;
            }
        }
Reply
#2

pawn Код:
case D_LOGIN:
        {
            if (!response ) return Kick (playerid);
            {
                if(udb_hash(inputtext) == pFiles[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SendClientMessage(playerid,C_WHITE,"You have succesfuly loggedin to server");
                }
                else
                {
                    new ldialog[500],lattemp[MAX_PLAYERS],try[128];
                    lattemp [playerid] += 1;
                    switch(lattemp[playerid])
                    {
                        case 1: try = "Three Loggedin Attempt Left ";
                        case 2: try = "Two Loggedin Attempt Left ";
                        case 3: try = "One Loggedin Attempt Left ";
                    }
                    if(lattemp[playerid] == 0)
                    {
                        format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
                        ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,""CSERVER"est",ldialog,"Login","Quit");
                    }
                    else if(lattemp[playerid] >= 1)
                    {
                        format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
                        ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,"Test",ldialog,"Login","Quit");
                    }
                    if(lattemp [playerid] == 4)
                    {
                        new string[128];
                        format(string,sizeof(string),""CORANGE"%s"CWHITE" has been kicked from the server ( "CRED"MAX LOGIN ATTEMPT"CWHITE" )");
                        SendClientMessageToAll(C_WHITE,string);
                    }
                }
                return 1;
            }
        }
You needed to remove the if(response) line you already had, you simply stated it twice which is most likely the issue.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)