[HELP]Dialog Script - 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: [HELP]Dialog Script (
/showthread.php?tid=306578)
[HELP]Dialog Script -
eemalekorraks - 27.12.2011
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
Re: [HELP]Dialog Script -
Seven_of_Nine - 27.12.2011
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()!
Re: [HELP]Dialog Script -
eemalekorraks - 27.12.2011
Already Update
Re: [HELP]Dialog Script -
spedico - 27.12.2011
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;
}
Re: [HELP]Dialog Script -
eemalekorraks - 27.12.2011
Thanks Alot Spedico And Seven_Of Nine