Login Dialog problem
#1

Alright all the errors have been fixed, but now register system works but when you try to login with your password it says its incorrect but if you don't fill in anything at all and click login you will just login. So this the code we use:

pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                //if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                if(strlen(inputtext) == PInfo[playerid][Password]) {
                //if(strcmp(inputtext, PInfo[playerid][Password])) {
                    new file[64], password2[23], PlayerName[24];
                    GetPlayerName(playerid,PlayerName,sizeof PlayerName);
                    format(file,sizeof file,"Admin/%s.ini",PlayerName);
                    INI_Open(file);//Opening the file with SII include
                    INI_ReadString(password2,"Password");
                    PInfo[playerid][Level] = INI_ReadInt("Level");//Setting the admin level variable, to the one thats in his file.
                    PInfo[playerid][Score] = INI_ReadInt("Score"); // Setting the score of player
                    PInfo[playerid][Money] = INI_ReadInt("Money"); // Setting the money of player
                    INI_Close();//"Closing the file", that means that we're not using it anymore :P
                    SendClientMessage(playerid,-1,"You have been successfully logged in!");
                    PInfo[playerid][Logged] = 1;//Setting the logged in variable to 1
                    SetPlayerScore(playerid, PInfo[playerid][Score]);
                    GivePlayerMoney(playerid, PInfo[playerid][Money]);
                } else {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
Reply


Messages In This Thread
Login Dialog problem - by Biess - 20.12.2012, 20:58
Re: Login Dialog problem - by ikkentim - 20.12.2012, 21:00
Re: Login Dialog problem - by park4bmx - 20.12.2012, 21:06
Re: Login Dialog problem - by Biess - 20.12.2012, 21:08
Re: Login Dialog problem - by Threshold - 20.12.2012, 21:28
Re: Login Dialog problem - by Biess - 20.12.2012, 21:37
Re: Login Dialog problem - by Threshold - 20.12.2012, 21:38
Re: Login Dialog problem - by Biess - 20.12.2012, 22:00
Re: Login Dialog problem - by Kaaajmak - 20.12.2012, 22:09
Re: Login Dialog problem - by Biess - 20.12.2012, 22:11

Forum Jump:


Users browsing this thread: 1 Guest(s)