SA-MP Forums Archive
[HELP] 2 dialogs after each other - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] 2 dialogs after each other (/showthread.php?tid=266923)



[HELP] 2 dialogs after each other - matjer - 06.07.2011

pawn Код:
//connect
public OnPlayerConnect{
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN","Uw wachtwoord:","Login","Cancel");
    ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Uw begin land?:","Los Santos\r\nSan Fierro \r\nLas Venturas","Select","Cancel");
}
//dialog
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==3)
    {
        if(response==0)
        {
            SendClientMessage(playerid,BLAU,"Bye Bye!");
            Kick(playerid);
            return 1;
        }
        if(response==1)
        {
            if(!strlen(inputtext))
            {
                SendClientMessage(playerid,BLAU,"Uw wactwoord is niet lang genoeg.");
                    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN","Uw wachtwoord:","Login","Cancel");
                return 1;
            }
            else
            {
           Login(playerid,inputtext);
           //kies land
           if( (GetPVarInt(playerid,"PaspoortSF") == 0) && (GetPVarInt(playerid,"PaspoortLS") == 0) && (GetPVarInt(playerid,"PaspoortLV") == 0) )
           {
              ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Uw begin land?:","Los Santos\r\nSan Fierro \r\nLas Venturas","Select","Cancel");
           }
           return 0;
        }
        }
    }
        if(dialogid==8) //paspoort
    {
        if(response==0)
        {
            //maak LS paspoort
            new Spelerbestand[64];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
            dini_IntSet(Spelerbestand,"PaspoortLS",1);
            SetPVarInt(playerid,"PaspoortLS",dini_Int(Spelerbestand,"PaspoortLS"));
            //---
            enterLS[playerid] = 1;
            enterSF[playerid] = 0;
            enterLV[playerid] = 0;
            return 1;
        }
        if(response==1)
        {
            switch(listitem)
            {
                case 0:
                {
                    //maak LS paspoort
                    new Spelerbestand[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
                    dini_IntSet(Spelerbestand,"PaspoortLS",1);
                    SetPVarInt(playerid,"PaspoortLS",dini_Int(Spelerbestand,"PaspoortLS"));
                    //---
                    enterLS[playerid] = 1;
                    enterSF[playerid] = 0;
                    enterLV[playerid] = 0;
                    return 1;
                }
                case 1:
                {
                    //maak SF paspoort
                    new Spelerbestand[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
                    dini_IntSet(Spelerbestand,"PaspoortSF",1);
                    SetPVarInt(playerid,"PaspoortSF",dini_Int(Spelerbestand,"PaspoortSF"));
                    //---
                    enterLS[playerid] = 0;
                    enterSF[playerid] = 1;
                    enterLV[playerid] = 0;
                    return 1;
                }
                case 2:
                {
                    //maak LV paspoort
                    new Spelerbestand[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
                    dini_IntSet(Spelerbestand,"PaspoortLV",1);
                    SetPVarInt(playerid,"PaspoortLV",dini_Int(Spelerbestand,"PaspoortLV"));
                    //---
                    enterLS[playerid] = 0;
                    enterSF[playerid] = 0;
                    enterLV[playerid] = 1;
                    return 1;
                }
            }
        }
}
He only show the last dialog how to solve this ?
Plzz help me!

matjer


Re: [HELP] 2 dialogs after each other - Wesley221 - 06.07.2011

Make the second dialog pop up after you did the first dialog.
So, you log in with the first dialog, after you logged it make the second dialog pop up


Re: [HELP] 2 dialogs after each other - matjer - 06.07.2011

yes but it doesn't do that
I don't know how do to that


Re: [HELP] 2 dialogs after each other - Wesley221 - 06.07.2011

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) // Ill use this one as the login dialog
    {
        if(response)
        {
            // Bla bla bla, load your stuff, check if the password is right
            // After that, do this line (when he is actually logged in)
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Uw begin land", "Bla \nbla \nbla", "Ok", "");
        }
        else
        {
            Kick(playerid);
        }
    }
    return 1;
}
Just a rough example, but should give you an idea how to make it work


Re: [HELP] 2 dialogs after each other - matjer - 06.07.2011

Ok that works but now I have another problem.

When the seconde dialog popup then he goes too requestclass but he must do that after dialog 2


Re: [HELP] 2 dialogs after each other - Wesley221 - 06.07.2011

You mean, you log in, then need to choose your city you wanna start in, and after that you need to see the requestclass?


Re: [HELP] 2 dialogs after each other - matjer - 06.07.2011

yes that I want
Now the code pls


Re: [HELP] 2 dialogs after each other - Wesley221 - 06.07.2011

Do what i said before, it will show you the first dialog, and after you logged in (pressed the OK button with the right password) the next dialog pops up.


Re: [HELP] 2 dialogs after each other - matjer - 06.07.2011

I did do that look:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        //login
    if(dialogid==3)
    {
        if(response==0)
        {
            SendClientMessage(playerid,BLAU,"Bye Bye!");
            Kick(playerid);
            return 1;
        }
        if(response==1)
        {
            if(!strlen(inputtext))
            {
                SendClientMessage(playerid,BLAU,"Uw wactwoord is niet lang genoeg.");
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN","Uw wachtwoord:","Login","Cancel");
                return 1;
            }
            else
            {
                Login(playerid,inputtext);
                //kies land
                if( (GetPVarInt(playerid,"PaspoortSF") == 0) && (GetPVarInt(playerid,"PaspoortLS") == 0) && (GetPVarInt(playerid,"PaspoortLV") == 0) )
                {
                    ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Uw begin land?:","Los Santos\r\nSan Fierro \r\nLas Venturas","Select","Cancel");
                }
                return 0;
            }
        }
    }
    //register
    if(dialogid==2)
    {
        if(response==0)
        {
            SendClientMessage(playerid,BLAU,"Bye Bye!");
            Kick(playerid);
            return 1;
        }
        if(response==1)
        {
            if(!strlen(inputtext))
            {
                SendClientMessage(playerid,BLAU,"Het wachtwoord is niet lang genoeg.");
                ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"REGISTER","Uw wachtwoord:","Register","Cancel");
                return 1;
            }
            else
            {
                Register(playerid,inputtext);
                ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Uw begin land?:","Los Santos\r\nSan Fierro \r\nLas Venturas","Select","Cancel");
                return 0;
            }
        }
    }
        if(dialogid==8) //paspoort
    {
        if(response==0)
        {
            //maak LS paspoort
            new Spelerbestand[64];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
            dini_IntSet(Spelerbestand,"PaspoortLS",1);
            SetPVarInt(playerid,"PaspoortLS",dini_Int(Spelerbestand,"PaspoortLS"));
            //---
            enterLS[playerid] = 1;
            enterSF[playerid] = 0;
            enterLV[playerid] = 0;
            return 1;
        }
        if(response==1)
        {
            switch(listitem)
            {
                case 0:
                {
                    //maak LS paspoort
                    new Spelerbestand[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
                    dini_IntSet(Spelerbestand,"PaspoortLS",1);
                    SetPVarInt(playerid,"PaspoortLS",dini_Int(Spelerbestand,"PaspoortLS"));
                    //---
                    enterLS[playerid] = 1;
                    enterSF[playerid] = 0;
                    enterLV[playerid] = 0;
                    return 1;
                }
                case 1:
                {
                    //maak SF paspoort
                    new Spelerbestand[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
                    dini_IntSet(Spelerbestand,"PaspoortSF",1);
                    SetPVarInt(playerid,"PaspoortSF",dini_Int(Spelerbestand,"PaspoortSF"));
                    //---
                    enterLS[playerid] = 0;
                    enterSF[playerid] = 1;
                    enterLV[playerid] = 0;
                    return 1;
                }
                case 2:
                {
                    //maak LV paspoort
                    new Spelerbestand[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,name,sizeof(name));
                    format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
                    dini_IntSet(Spelerbestand,"PaspoortLV",1);
                    SetPVarInt(playerid,"PaspoortLV",dini_Int(Spelerbestand,"PaspoortLV"));
                    //---
                    enterLS[playerid] = 0;
                    enterSF[playerid] = 0;
                    enterLV[playerid] = 1;
                    return 1;
                }
            }
        }
    return 1;
}
OnPlayerConnect:

pawn Код:
public OnPlayerConnect(playerid)
{
        new Spelerbestand[64];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
        format(Spelerbestand,sizeof(Spelerbestand),"/Accounts/%s.txt",name);
        if(dini_Exists(Spelerbestand))
        {
            ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN","Uw wachtwoord:","Login","Cancel");
        }
        else
        {
            ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"REGISTER","Uw wachtwoord:","Register","Cancel");
            //ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Uw begin land?:","Los Santos\r\nSan Fierro \r\nLas Venturas","Select","Cancel");
        }
    return 1;
}



Re: [HELP] 2 dialogs after each other - matjer - 06.07.2011

pls HELP !!!