#1

pawn Код:
if( dialogid == 4 )
    {
        if( response )
        {
            if( GetPVarInt( playerid, "BlogiPrisijungimai" ) < 3 )
            {
                new
                    Failas[ 51 ]
                ;
                format( Failas, 51, "DuomenuBaze/Zaidejai/%s.ini", ZaidejoVardas( playerid ) );
                if( PatikrintiZaidejoSlaptazodi( Failas, inputtext ) )
                {
                    SendClientMessage( playerid, -1, ""#h_Balta"[ > ] Sлkmingai "#h_Raudona"prisijungлte" );
                }
                else
                {
                    SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Jыs buvote "#h_Raudona"iрmestas iр serverio. ["#h_Orandzine"3 blogi prisijungimai]" );
                    Kick( playerid );
                }
            }
            else
            {
                SetPVarInt( playerid, "BlogiPrisijungimai", GetPVarInt( playerid, "BlogiPrisijungimai" ) + 1 );
                new
                    Stringas[ 145 ]
                ;
                format( Stringas, 145, ""#h_Raudona"Blogai "#h_Balta"suvestas slaptaюodis.\n"#h_Zalia"Bandykite dar. "#h_Raudona"Likж bandymш: "#h_Geltona"%d", 3 - GetPVarInt( playerid, "BlogiPrisijungimai" ) );
                ShowPlayerDialog( playerid, 4, DIALOG_STYLE_INPUT, ""#h_Geltona"Prisi"#h_Zalia"jun"#h_Raudona"gimas", Stringas, "Vesti", "Palikti" );
            }
        }
        else
        {
            Kick( playerid );
        }
    }
And, when I enter the password - I get kicked.
Reply
#2

Maybe you can better translate the stuff to english first
Reply
#3

pawn Код:
if( dialogid == 4 )
    {
        if( response )
        {
            if( GetPVarInt( playerid, "BadLogins" ) < 3 )
            {
                new
                    Failas[ 51 ]
                ;
                format( Failas, 51, "DuomenuBaze/Zaidejai/%s.ini", PlayerNick( playerid ) );
                if( CheckPassword( Failas, inputtext ) )
                {
                    SendClientMessage( playerid, -1, ""#h_Balta"[ > ] Succesfully "#h_Raudona"logged in" );
                }
                else
                {
                    SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"You have been kicked "#h_Raudona"from server. ["#h_Orandzine"3 bad logins]" );
                    Kick( playerid );
                }
            }
            else
            {
                SetPVarInt( playerid, "BadLogins", GetPVarInt( playerid, "BadLogins" ) + 1 );
                new
                    Stringas[ 145 ]
                ;
                format( Stringas, 145, ""#h_Raudona"The inputted "#h_Balta"password is BAD.\n"#h_Zalia"Try again. "#h_Raudona"You can try to login: "#h_Geltona"%d times", 3 - GetPVarInt( playerid, "BadLogins" ) );
                ShowPlayerDialog( playerid, 4, DIALOG_STYLE_INPUT, ""#h_Geltona"Prisi"#h_Zalia"jun"#h_Raudona"gimas", Stringas, "Login", "Leave" );
            }
        }
        else
        {
            Kick( playerid );
        }
    }
srry for bad english.
Reply
#4

The problem is this function:
PatikrintiZaidejoSlaptazodi( Failas, inputtext )
it compares the password the wrong way or something
Reply
#5

No. Because, player get kicked only if he entered bad password 3 times.
Reply
#6

You're comparing the player's file with the password ...

pawn Код:
format( Failas, 51, "DuomenuBaze/Zaidejai/%s.ini", PlayerNick( playerid ) );
                if( CheckPassword( Failas, inputtext ) )
                {
                    SendClientMessage( playerid, -1, ""#h_Balta"[ > ] Succesfully "#h_Raudona"logged in" );
                }
Or CheckPassword uses the player file to get the password and compare?
Reply
#7

There are two kick() in your code. The one is called when response == 0, that means, when you press abort. The other one is called when PatikrintiZaidejoSlaptazodi( Failas, inputtext ) == 0
This means it has to be that function.
Reply
#8

So, it's else fail, or what? Because in script are:

pawn Код:
SetPVarInt( playerid, "BadLogins", GetPVarInt( playerid, "BadLogins" ) + 1 );
                new
                    Stringas[ 145 ]
                ;
                format( Stringas, 145, ""#h_Raudona"The inputted "#h_Balta"password is BAD.\n"#h_Zalia"Try again. "#h_Raudona"You can try to login: "#h_Geltona"%d times", 3 - GetPVarInt( playerid, "BadLogins" ) );
                ShowPlayerDialog( playerid, 4, DIALOG_STYLE_INPUT, ""#h_Geltona"Prisi"#h_Zalia"jun"#h_Raudona"gimas", Stringas, "Login", "Leave" );
So, the player will be kicked if he entered bad password 3 times.
Reply
#9

Post the PatikrintiZaidejoSlaptazodi( ) funtion please.
Reply
#10

stock PatikrintiZaidejoSlaptazodi( Failas[ ], Slaptazodis[ ] )
{
if( !strcmp( dini_Get( Failas, "Slaptazodis" ), Slaptazodis, true ) ) return true;
return false;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)