SA-MP Forums Archive
Problem with my register dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with my register dialog (/showthread.php?tid=279660)



Problem with my register dialog - gahal156 - 28.08.2011

It show me to pic gender and region all the times even tough im register





Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if (response)
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
                }

                if(INI_Open(getINI(playerid))) {
                INI_WriteString("Password",inputtext);
                INI_WriteInt("Score",1);
                INI_WriteInt("Cash",5000);
                INI_WriteInt("Admin",0);

                INI_Save();
                INI_Close();

                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
            }
        }
    }
        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
                }

                if(INI_Open(getINI(playerid))) {
                INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);

                if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
                }

                SetPlayerScore( playerid, INI_ReadInt("Score" ) );
                ResetPlayerMoney( playerid );
                GivePlayerMoney( playerid, INI_ReadInt( "Cash" ) );
                PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                INI_Close();
                
                ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT, ""WHITE"Question...",""RED"Just a few question to start.\n"WHITE"Are you Male or Female?","OK","Cancel");
                }
            }
        }
        case DIALOG_GENDER:
        {
            if (!response) return Kick(playerid);
            if (response)
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT, ""WHITE"Question...",""RED"Just a few question to start.\n"WHITE"Type your gender below","OK","Cancel");
                }

                if(INI_Open(getINI(playerid))) {
                INI_WriteString("Gender",inputtext);
                INI_WriteInt("Score",1);
                INI_WriteInt("Cash",5000);
                INI_WriteInt("Admin",0);

                INI_Save();
                INI_Close();
                
                ShowPlayerDialog(playerid, DIALOG_REGION, DIALOG_STYLE_INPUT, ""WHITE"Next question...",""RED"OK.\n"WHITE"Where are you from?","OK","Cancel");
                }
            }
        }
        case DIALOG_REGION:
        {
            if (!response) return Kick(playerid);
            if (response)
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_REGION, DIALOG_STYLE_INPUT, ""WHITE"Next question...",""RED"OK.\n"WHITE"Where are you from?","OK","Cancel");
                }

                if(INI_Open(getINI(playerid))) {
                INI_WriteString("Region",inputtext);
                INI_WriteInt("Score",1);
                INI_WriteInt("Cash",5000);
                INI_WriteInt("Admin",0);

                INI_Save();
                INI_Close();
            }
        }
    }
    }
    return 1;
}



Re: Problem with my register dialog - [MWR]Blood - 28.08.2011

LOL Uninstall ****** man...


Re: Problem with my register dialog - Niko_boy - 28.08.2011

Really strange Bug !!
I tooo Need to know how it appeared :P


Re: Problem with my register dialog - gahal156 - 28.08.2011

answer on my first question please


Re: Problem with my register dialog - Kush - 28.08.2011

Un-install your hacks, thats what you gotta do.


Re: Problem with my register dialog - gahal156 - 28.08.2011

i use the hacks just to take positions and things/:
leave the second problem help me with the first!!