Help with this one
#1

My problem is

when i put an emty text on the dialog
it will accept and will let the player log in help me
but when i put a wrong password it will not accept


pawn Код:
public OnPlayerLogin(playerid,pasword[])
{
    new attemts = 3;
    if(!strcmp(pasword,pData[playerid][pPass]))
    {
        SendClientMessage(playerid,C_WHITE,"Welcome Back");
        INI_ParseFile(pFiles(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    }
    else
    {
        attemts -= 1;
        new l_msg[500];
        format(l_msg,sizeof(l_msg),"Welcome Back "CGREEN"%s"CWHITE" This Account is registred \nPlease Enter your password to login \n\n "CRED"[ Error ]: You have entered a invalid password \n you have %d more attemts left",pName(playerid),attemts);
        ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,servername(),l_msg,"login","cancel");
        if(attemts == 0 )
        {
            return BotKick(playerid,"Failure to Login");
        }
    }
    return 1;
}
Reply
#2

Add this line in onplayerdialog response
pawn Код:
if(inputtext < 3) return sentclientmessage(playerid, color , "password must more than 3 letters");
Reply
#3

or:
pawn Код:
if(!strlen(inputtext)) return SendClientMessage(playerid, 0xFF0000FF, "You must enter a password!");
//Also kick player if you want, unless it's already included
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)