[HELP]Dialog Script
#1

So im trying to make an audio player here and heres the code.
Код:
if(response)
    {
    switch(dialogid)
        {
		case 1:
    	    {
           	  switch(listitem)
        	  {
			    case 0:
			    {
			     ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Choose Your Track", "\nTrack1\nTrack2","Select","Exit");
			    }
			    case 1:
			    {
	             PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/xd6mr82eh5/blue_stahli_ultranumb.mp3");
                }

			  }
			 }
		}
		return 1;
	 }
	   


if(response)
   {
   switch(dialogid)
	 {
	 case 2:
		{
		   switch(listitem)
		   {
			case 0:
			{
			PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/9r0ej8r9l1/2pac_hit_em_up_lyrics.mp3");
			}
			case 1:
			{
			PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/xd6mr82eh5/blue_stahli_ultranumb.mp3");
			}
		 }
	  }
	}
Now i looked up some error helping and it said that i need to write return 1; to
Код:
case 1:
			{
			PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/xd6mr82eh5/blue_stahli_ultranumb.mp3");
			}
		 }
	  }
return 1;
	}
Here but before i had the error of compunding 030,and now it vanishes and error 002 appears.Only a single statement can follow each case.
Any Help is appreciated
Reply
#2

Please put in a [code] tag because I can't see through it. o.o

I guess a switch() can't be inside of an other switch(). Try with if()!
Reply
#3

Already Update
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            switch(listitem)
            {
                case 0:
                {
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Choose Your Track", "\nTrack1\nTrack2","Select","Exit");
                }
                case 1:
                {
                    PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/xd6mr82eh5/blue_stahli_ultranumb.mp3");
                }
            }
        }
    case 2:
    {
        switch(listitem)
        {
            case 0:
            {
                PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/9r0ej8r9l1/2pac_hit_em_up_lyrics.mp3");
            }
            case 1:
            {
                PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/xd6mr82eh5/blue_stahli_ultranumb.mp3");
            }
         }
        }
    }
    return 1;
}
Reply
#5

Thanks Alot Spedico And Seven_Of Nine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)