Ugh, another problem (Sorry if I spammed too much)
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/music", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "Music: Page 1", "1. Daniel Kim - Pop Danthology 2012\n2. Memphis May Fire - Grenade\n3. Upon This dawning - Call Me Maybe\n4. Mayday Parade - Somebody That I Used To Know\n5. We Came As Romans - Glad You Came\n6. Like Moths to Flame - Some Nights\n7. Breathe Carolina - Billie Jean\n8. Forever The Sickest Kids - We Found Love\n9. Issues - Boyfriend\n10. The Maine - Girls Just Want To Have Fun", "Play", "Cancel");
        return 1;
    }
   
    if (strcmp("/music2", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 70, DIALOG_STYLE_LIST, "Music: Page 2", "11. Crown The Empire - Payphone\n12. Craig Owens - Paradise\n13. The Word Alive - Mercy\n14. Secrets - Ass Back Home", "Play", "Cancel");
        return 1;
    }
   
    return 0;
}
Yes, the /music works, but /music2 is not working. Here's the OnPlayerResponse.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)// They pressed the first button.
    {
        switch(dialogid)
        {
            case 69:// Our dialog!
            {
                switch(listitem)// Checking which listitem was selected
            {
                case 0: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/Daniel%20Kim%20-%20Pop%20Danthology%202012.mp3");
                case 1: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/01%20-%20Memphis%20May%20Fire%20-%20Grenade.mp3");
                case 2: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/02%20-%20Upon%20This%20dawning%20-%20Call%20Me%20Maybe.mp3");
                case 3: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/03%20-%20Mayday%20Parade%20-%20Somebody%20That%20I%20Used%20To%20Know%20(Ft.%20Vic%20Fuentes).mp3");
                case 4: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/04%20-%20We%20Came%20As%20Romans%20-%20Glad%20You%20Came.mp3");
                case 5: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/05%20-%20Like%20Moths%20To%20Flames%20-%20Some%20Nights.mp3");
                case 6: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/06%20-%20Breathe%20Carolina%20-%20Billie%20Jean.mp3");
                case 7: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/07%20-%20Forever%20The%20Sickest%20Kids%20-%20We%20Found%20Love.mp3");
                case 8: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/08%20-%20Issues%20-%20Boyfriend.mp3");
                case 9: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/09%20-%20The%20Maine%20-%20Girls%20Just%20Want%20To%20Have%20Fun%20(Ft.%20Adam%20Lazzara).mp3");
            }
            }

            case 70:
            {
                switch(listitem)
            {
                case 10: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/10%20-%20Crown%20The%20Empire%20-%20Payphone.mp3");
                case 11: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/11%20-%20Craig%20Owens%20-%20Paradise.mp3");
                case 12: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/12%20-%20The%20Word%20Alive%20-%20Mercy.mp3");
                case 13: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/13%20-%20Secrets%20-%20Ass%20Back%20Home.mp3");
            }
            }
        }
    }
    return 1;
}
A question, how many characters are allowed in ShowPlayerDialog?
Reply
#2

Change 10, 11, 12 and 13 to 1, 2, 3 and 4. Its a new dialog, so listitem is reset.
Reply
#3

Quote:
Originally Posted by Strawhats
Посмотреть сообщение
Change 10, 11, 12 and 13 to 1, 2, 3 and 4. Its a new dialog, so listitem is reset.
Thanks, I tested it. +REP. (Will do it later. )
Reply
#4

No problem. GL with your project!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)