ondialogresponse help
#1

Music dialog works fine, but SONG_DIALOG dont


PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == MUSIC_DIALOG)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:PlayAudioStreamForPlayer(playerid"http://music.huoxing.com/upload/20120820/1345475241360_3125.mp3");
                case 
1:PlayAudioStreamForPlayer(playerid"http://www.woo55.com/adata/6131/01%20-%20The%20Black%20Eyed%20Peas%20-%20Boom%20Boom%20Pow%20-%20(www.SongsLover.com).mp3");
                case 
2:PlayAudioStreamForPlayer(playerid"http://dl32.musload.com/loads/dlhash1/49/62/2198045-6f8ab8e322e5.mp3");
                case 
3:PlayAudioStreamForPlayer(playerid"http://a.tumblr.com/tumblr_mcmsn2OiCe1qakeefo1.mp3");
            }
        }
    if(
dialogid == SONG_DIALOG)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:PlayAudioStreamForPlayer(playerid"http://xsfserver.com/music/Gangnam.mp3");
                case 
1:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/sPartyRocking.mp3");
                case 
2:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/Sexy.mp3");
                case 
3:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/CountingStars.mp3");
                case 
5:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/LetItRock.mp3");
            }
        }
        return 
1;
        }
    }
    return 
0
i even tried it this way, however only MUSIC_DIALOG works
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == MUSIC_DIALOG)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:PlayAudioStreamForPlayer(playerid"http://music.huoxing.com/upload/20120820/1345475241360_3125.mp3");
                case 
1:PlayAudioStreamForPlayer(playerid"http://www.woo55.com/adata/6131/01%20-%20The%20Black%20Eyed%20Peas%20-%20Boom%20Boom%20Pow%20-%20(www.SongsLover.com).mp3");
                case 
2:PlayAudioStreamForPlayer(playerid"http://dl32.musload.com/loads/dlhash1/49/62/2198045-6f8ab8e322e5.mp3");
                case 
3:PlayAudioStreamForPlayer(playerid"http://a.tumblr.com/tumblr_mcmsn2OiCe1qakeefo1.mp3");
            }
        }
        return 
1;
    }
    return 
0;
    if(
dialogid == SONG_DIALOG)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:PlayAudioStreamForPlayer(playerid"http://xsfserver.com/music/Gangnam.mp3");
                case 
1:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/sPartyRocking.mp3");
                case 
2:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/Sexy.mp3");
                case 
3:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/CountingStars.mp3");
                case 
5:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/LetItRock.mp3");
            }
        }
        return 
1;
    }
    return 
0;

Please tell me what am i doing wrong,
EDIT: i also got the warning "warning 225: unreachable code"
Reply
#2

Try with this.

PHP код:
if(dialogid == SONG_DIALOG)
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0:PlayAudioStreamForPlayer(playerid"http://xsfserver.com/music/Gangnam.mp3");
            case 
1:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/sPartyRocking.mp3");
            case 
2:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/Sexy.mp3");
            case 
3:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/CountingStars.mp3");
            case 
5:PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/LetItRock.mp3");
        }
    }
    return 
1;

Reply
#3

Correct is this:
PHP код:

if(dialogid == SONG_DIALOG

    if(
response
    {
            if(
listitem== 0PlayAudioStreamForPlayer(playerid"http://xsfserver.com/music/Gangnam.mp3"); 
            if(
listitem== 1PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/sPartyRocking.mp3"); 
            if(
listitem== 2PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/Sexy.mp3"); 
            if(
listitem== 3PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/CountingStars.mp3"); 
            if(
listitem== 4PlayAudioStreamForPlayer(playerid,"http://xsfserver.com/music/LetItRock.mp3"); 
        
    } 
    return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)