SA-MP Forums Archive
Second dialog chosen from another dialog dosen't show up - 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: Second dialog chosen from another dialog dosen't show up (/showthread.php?tid=410837)



Second dialog chosen from another dialog dosen't show up - gnoomen2 - 26.01.2013

When i have typed /playmusic the dialog shows up, i click next page, but then the next dialog dosent show up.

This is my code:

pawn Код:
#define DIALOG_MUSIC 3443
#define DIALOG_MUSIC2 3442
pawn Код:
COMMAND:playmusic(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        ShowPlayerDialog(playerid, DIALOG_MUSIC, DIALOG_STYLE_LIST, "Choose a song", "Sandstorm - Darude\nDanza Kuduro - Don Omar\nDragon Born - Headhunterz\nKill For Lies - Ulrik Munther\nLabrinth Ft. Emeli Sande - Beneath Your Beautiful\nDon't Laugh At Me - Mark Wills\nA1 - Caught In The Middle\nA1 - Don't Wanna Lose You Again\nEminem - Like Toy Soldiers\nEminem - Mocking Bird\nEminem - Talking To My self\nNext Page", "Select", "Close");
    }
    return 1;
pawn Код:
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_MUSIC)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem == 0) // They selected the first item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 1);
            }
            if(listitem == 1) // They selected the second item - AK-47
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 2);
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 3);
            }
            if(listitem == 3) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 3);
            }
            if(listitem == 4) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 4);
            }
            if(listitem == 5) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 5);
            }

            if(listitem == 6) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 6);
            }
            if(listitem == 7) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 7);
            }
            if(listitem == 8) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 8);
            }
            if(listitem == 9) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 9);
            }
            if(listitem == 10) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 10);
            }
            if(listitem == 11) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 11);
            }
            if(listitem == 12) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                ShowPlayerDialog(playerid, DIALOG_MUSIC2, DIALOG_STYLE_LIST, "Page 2", "Akon - Don't Matter\nSo Sick - Ne-Yo\nBehind Blue Eyes - Limp Bizkit\nSkyscraper - Demi Lovato\nUnder The Bridge - Red Hot Chili Peppers\nRidin' Dirty - Chamillionaire\nThe Axis Of Awesome 4 Chords", "Select", "Close");
            }
            if(dialogid == DIALOG_MUSIC2)
            {
                if(response) // If they clicked 'Select' or double-clicked a weapon
                {
                    if(listitem == 0) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 12);
                    }
                    if(listitem == 1) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 13);
                    }
                    if(listitem == 2) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 14);
                    }
                    if(listitem == 3) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                    Audio_Play(i, 15);
                    }
                    if(listitem == 4) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 16);
                    }
                    if(listitem == 5) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 17);
                    }
                    if(listitem == 6) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 18);
                    }
                    if(listitem == 7) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 21);
                    }
                }
            }

        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}



Re: Second dialog chosen from another dialog dosen't show up - Jewell - 27.01.2013

problem was this line
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
            {
                ShowPlayerDialog(playerid, DIALOG_MUSIC2, DIALOG_STYLE_LIST, "Page 2", "Akon - Don't Matter\nSo Sick - Ne-Yo\nBehind Blue Eyes - Limp Bizkit\nSkyscraper - Demi Lovato\nUnder The Bridge - Red Hot Chili Peppers\nRidin' Dirty - Chamillionaire\nThe Axis Of Awesome 4 Chords", "Select", "Close");
            }
try now
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_MUSIC)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem == 0) // They selected the first item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 1);
            }
            if(listitem == 1) // They selected the second item - AK-47
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 2);
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 3);
            }
            if(listitem == 3) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 3);
            }
            if(listitem == 4) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 4);
            }
            if(listitem == 5) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 5);
            }

            if(listitem == 6) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 6);
            }
            if(listitem == 7) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 7);
            }
            if(listitem == 8) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 8);
            }
            if(listitem == 9) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 9);
            }
            if(listitem == 10) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 10);
            }
            if(listitem == 11) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 11);
            }
            if(listitem == 12) // They selected the third item - Desert Eagle
            {
                ShowPlayerDialog(playerid, DIALOG_MUSIC2, DIALOG_STYLE_LIST, "Page 2", "Akon - Don't Matter\nSo Sick - Ne-Yo\nBehind Blue Eyes - Limp Bizkit\nSkyscraper - Demi Lovato\nUnder The Bridge - Red Hot Chili Peppers\nRidin' Dirty - Chamillionaire\nThe Axis Of Awesome 4 Chords", "Select", "Close");
            }
            if(dialogid == DIALOG_MUSIC2)
            {
                if(response) // If they clicked 'Select' or double-clicked a weapon
                {
                    if(listitem == 0) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 12);
                    }
                    if(listitem == 1) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 13);
                    }
                    if(listitem == 2) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 14);
                    }
                    if(listitem == 3) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                    Audio_Play(i, 15);
                    }
                    if(listitem == 4) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 16);
                    }
                    if(listitem == 5) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 17);
                    }
                    if(listitem == 6) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 18);
                    }
                    if(listitem == 7) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 21);
                    }
                }
            }

        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}



Re: Second dialog chosen from another dialog dosen't show up - gnoomen2 - 27.01.2013

That didn't work.


Re: Second dialog chosen from another dialog dosen't show up - Youice - 27.01.2013

here Try:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_MUSIC)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem == 0) // They selected the first item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 1);
            }
            if(listitem == 1) // They selected the second item - AK-47
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 2);
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 3);
            }
            if(listitem == 3) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 3);
            }
            if(listitem == 4) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 4);
            }
            if(listitem == 5) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 5);
            }

            if(listitem == 6) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 6);
            }
            if(listitem == 7) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 7);
            }
            if(listitem == 8) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 8);
            }
            if(listitem == 9) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 9);
            }
            if(listitem == 10) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 10);
            }
            if(listitem == 11) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                Audio_Play(i, 11);
            }
            if(listitem == 12) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                ShowPlayerDialog(playerid, DIALOG_MUSIC2, DIALOG_STYLE_LIST, "Page 2", "Akon - Don't Matter\nSo Sick - Ne-Yo\nBehind Blue Eyes - Limp Bizkit\nSkyscraper - Demi Lovato\nUnder The Bridge - Red Hot Chili Peppers\nRidin' Dirty - Chamillionaire\nThe Axis Of Awesome 4 Chords", "Select", "Close");
            }
        }
    }
    if(dialogid == DIALOG_MUSIC2)
            {
                if(response) // If they clicked 'Select' or double-clicked a weapon
                {
                    if(listitem == 0) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 12);
                    }
                    if(listitem == 1) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 13);
                    }
                    if(listitem == 2) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 14);
                    }
                    if(listitem == 3) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                    Audio_Play(i, 15);
                    }
                    if(listitem == 4) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 16);
                    }
                    if(listitem == 5) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 17);
                    }
                    if(listitem == 6) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 18);
                    }
                    if(listitem == 7) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 21);
                    }
                }
            }

        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}



Re: Second dialog chosen from another dialog dosen't show up - gnoomen2 - 31.01.2013

I get:

pawn Код:
error 010: invalid function or declaration
On
pawn Код:
return 1;
and
pawn Код:
return 0;



Re: Second dialog chosen from another dialog dosen't show up - mamorunl - 31.01.2013

Quote:
Originally Posted by gnoomen2
Посмотреть сообщение
When i have typed /playmusic the dialog shows up, i click next page, but then the next dialog dosent show up.

This is my code:

pawn Код:
#define DIALOG_MUSIC 3443
#define DIALOG_MUSIC2 3442
pawn Код:
COMMAND:playmusic(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        ShowPlayerDialog(playerid, DIALOG_MUSIC, DIALOG_STYLE_LIST, "Choose a song", "Sandstorm - Darude\n
Danza Kuduro - Don Omar\n
Dragon Born - Headhunterz\n
Kill For Lies - Ulrik Munther\n
Labrinth Ft. Emeli Sande - Beneath Your Beautiful\n
Don't Laugh At Me - Mark Wills\n
A1 - Caught In The Middle\n
A1 - Don't Wanna Lose You Again\n
Eminem - Like Toy Soldiers\n
Eminem - Mocking Bird\n
Eminem - Talking To My self\n
Next Page"
, "Select", "Close");
    }
    return 1;
pawn Код:
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_MUSIC)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem != 11) {
                for(new i = 0; i < MAX_PLAYERS; i++) {
                    Audio_Play(i, listitem+1);
                }
            } elseif(listitem == 12) {
                ShowPlayerDialog(playerid, DIALOG_MUSIC2, DIALOG_STYLE_LIST, "Page 2", "Akon - Don't Matter\nSo Sick - Ne-Yo\nBehind Blue Eyes - Limp Bizkit\nSkyscraper - Demi Lovato\nUnder The Bridge - Red Hot Chili Peppers\nRidin' Dirty - Chamillionaire\nThe Axis Of Awesome 4 Chords", "Select", "Close");
            }
            if(dialogid == DIALOG_MUSIC2)
            {
                if(response) // If they clicked 'Select' or double-clicked a weapon
                {
                    if(listitem == 0) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 12);
                    }
                    if(listitem == 1) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 13);
                    }
                    if(listitem == 2) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 14);
                    }
                    if(listitem == 3) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                    Audio_Play(i, 15);
                    }
                    if(listitem == 4) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 16);
                    }
                    if(listitem == 5) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 17);
                    }
                    if(listitem == 6) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 18);
                    }
                    if(listitem == 7) // They selected the third item - Desert Eagle
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        Audio_Play(i, 21);
                    }
                }
            }

        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
Short version above, longer version below (yours). Your list only contains 12 elements, starting at 0, that makes the last element (your "Next page >>") element 11, not 12.

You may choose my smaller version or stick with your own (own choice ofcourse). But this should fix your problem, as there is no 12th element.