Login & Register help
#1

Hello guys, i would like to know why this system isnt working the right way i mean if you register it suppose to save your acc right away but this here is like this you go in register, you have to relog go in again and then your acc saved

pawn Код:
switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_LIGHTBLUE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_LIGHTBLUE"Type your password below to register a new account.\nWe Welcome you Proudly in Forever Free Stunt Server Freeroam Server","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Score",0);
                INI_WriteInt(File,"DonatorLevel",0);
                INI_WriteInt(File,"AdminLevel",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_LIGHTBLUE"Registartion Completed",""COL_GREEN"Great! You Have Registerd, after you quit your stats will be saved\nGood Luck and Have fun staying in here\nif you dont relog your stats will not be saved!","Ok","");
                        }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_LIGHTBLUE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_LIGHTBLUE"Login to your Account",""COL_RED"You have entered an incorrect password.\n"COL_LIGHTBLUE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
return 1;
}
Thank you for the Help +rep who helps me!
Reply


Messages In This Thread
Login & Register help - by Acres - 12.08.2014, 14:41
Re: Login & Register help - by Don_Cage - 12.08.2014, 14:50
Re: Login & Register help - by Acres - 12.08.2014, 15:49
Re: Login & Register help - by Stinged - 12.08.2014, 15:55
Re: Login & Register help - by Don_Cage - 12.08.2014, 16:15

Forum Jump:


Users browsing this thread: 1 Guest(s)