Dialog messing :(
#1

when i start server and register. I register successfully but after 5 mins i have set a dialog to appear of top 5. When top 5 appears and i click ok another dialog appear of register. I don't know why it is appearing. Why both are messing with each other. Help Please if you have also been passed with this problem.
Reply
#2

I have an idea. Show the damn code.
Reply
#3

this is login and regsiter dialog. On player connect. Player regsiter but it comes again after an dialog.

pawn Код:
if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_WHITE"This account is {00FF22}already registered.\n{FFFFFF}Please login by entering your password in below","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid,dregister, DIALOG_STYLE_PASSWORD,""COL_RED"Register",""COL_WHITE"This account is{F81414} not yet registered \n{FFFFFF}Please create an account by typing your desired password below","Register","Quit");
        return 1;
    }
Reply
#4

Post the OnDialogResponse code.
Reply
#5

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == dregister)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            if(!strlen(inputtext))
            {
                ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
                return 1;
            }
           
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            new INI:file = INI_Open(Path(playerid));
            INI_SetTag(file,"Player's Data");
            INI_WriteString(file,"Password",hashpass);
            INI_WriteInt(file,"AdminLevel",0);
            INI_WriteInt(file,"VIPLevel",0);
            INI_WriteInt(file,"Money",0);
            INI_WriteInt(file,"Scores",0);
            INI_WriteInt(file,"Kills",0);
            INI_WriteInt(file,"Deaths",0);
            INI_WriteInt(file,"Warnings",0);
            INI_Close(file);
            SendClientMessage(playerid, GREEN ,"You successfuly created an account!");
           
            new
                str[ 128 ];
               
            format(str, sizeof(str), "[NEW ACCOUNT] Player %s has registered a new account!", GetName(playerid));
            SendClientMessageToAll(GREEN, str);
            return 1;
        }
    }
    if(dialogid == dlogin)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!strcmp(hashpass,pInfo[playerid][Pass]))
            {
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
                SetPlayerScore(playerid,pInfo[playerid][Scores]);
                GivePlayerMoney(playerid,pInfo[playerid][Money]);
                SendClientMessage(playerid, GREEN,"You have successfully logged in");
                new str[ 128 ], name[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, name, MAX_PLAYER_NAME );
                if ( pInfo[ playerid ][ Adminlevel ] > 0 )
                {
                    format( str, sizeof ( str ), "Administrator %s has logged in!", name );
                    SendClientMessageToAll( 0xFF9500FF, str);
                }
            }
            else
            {
                ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_RED"You have entered an{F81414} incorrect password.\n"COL_WHITE"Please try again","Login","Quit");
                return 1;
            }
        }
    }
    return 1;
}
Reply
#6

Your Dialog Id's are messed up.
You got skype?
Add me mrcnr145
Reply
#7

sorry but i don't have skype. Can't you expllain me here?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)