01.05.2014, 15:15
I have this radio script
When I do /radio a box comes asking the name of song but the song doesn't start at the first time i have to do /radio twice and select the same song to play it.
Please help me fix it.
This are the codes for the box which comes when i do /radio.
Код:
CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, "Pick your Channel/Song",
"{FF0000}Double Take\n{00FF00}A Billion Hits\n{0000FF}Better Together\n{FFFF00}Don't Look Down\n{FF5600}Can't Do It Without You\n{FF00FF}The Way That You Do\nIt's me It's You\n{00FFFF}Who I Am\n{00FF00}Not a Love Song\n{FF00FF}Stop Radio", "Choose", "Cancel");
SendCommandToAdmins(playerid,"/radio");
return 1;
Please help me fix it.

This are the codes for the box which comes when i do /radio.
Код:
if(dialogid == DIALOG_RADIO)
{
if(response)
{
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/ojnhq70h46/Double_Take.mp3");
}
case 1:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/p3sbf5iu31/A_billion_Hits.mp3");
}
case 2:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/d1pzlpxv7u/Better_Together.mp3");
}
case 3:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/rjv4pfvrtu/Don_t_look_down-Austin_and_Ally.mp3");
}
case 4:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/jziiv86g1v/Can_t_Do_it_Without_you.mp3");
}
case 5:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/mp2uovns9w/The_way_that_you_do.mp3");
}
case 6:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/margbszuyb/it_s_me_it_s_you.mp3");
}
case 7:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/7dbhudh549/ross-lynch-who-i-am-austin-and-ally.mp3");
}
case 8:
{
PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/ve3girvgyq/Not_a_Love_Song.mp3");
}
case 9:
{
StopAudioStreamForPlayer(playerid);
}
}
}
}

