Second dialog chosen from another dialog dosen't show up
#6

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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)