24.09.2017, 08:49
i made 3 dialogs :
Music dialog
Radio dialog
Admin Control Panel Dialog,
Music and Radio dialog working perfectly but when i opened admin control panel dialog and i click on any thing that i made for it, it will play stream that i put in radio
the defines are this :
and code :
i define them as cases i made for them for an example i put 5 songs in music dialog so i define it DIALOG_MUSIC 5
i defined DIALOG_RADIO 1 because i put 1 stream on it
Music dialog
Radio dialog
Admin Control Panel Dialog,
Music and Radio dialog working perfectly but when i opened admin control panel dialog and i click on any thing that i made for it, it will play stream that i put in radio
the defines are this :
PHP код:
#define DIALOG_MUSIC 5
#define DIALOG_RADIO 1
#define DIALOG_ADMIN 6
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_MUSIC)
{
if(response)
{
switch(listitem)
{
case 0: //English Songs
{
ShowPlayerDialog(playerid, DIALOG_MUSIC+1, DIALOG_STYLE_TABLIST_HEADERS, "English Songs", "Song \tArtist \tDuration \nCongratulations \tPost Malone \t4:16 \nDespacito \tJustin Bieber \t2:43 \nAll I Do \tLogic \t3:52", "Play", "Back");
}
case 1: //Hindi Songs
{
ShowPlayerDialog(playerid, DIALOG_MUSIC+2, DIALOG_STYLE_TABLIST_HEADERS, "Hindi Songs", "Song \tArtist \tDuration \nSoch \tChen-K \t3:18 \nNaamchor \tChen-K \t1:51", "Play", "Back");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You've closed the Music Dialog");
}
return 1;
}
if(dialogid == DIALOG_MUSIC+1) //English Songs
{
if(response)
{
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/q16rvkee67/Post_Malone_-_Congratulations_Meroshi_Trap_Remix_.mp3");
SendClientMessage(playerid, COLOR_WHITE, "Type {FF6600}/stop{FFFFFF} to stop the music");
}
case 1:
{
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/ysgwj5jw8m/Justin_Bieber_-_Despacito_Jeydee_Club_Mix_ft._Luis_Fonsi_Daddy_Yankee.mp3");
SendClientMessage(playerid, COLOR_WHITE, "Type {FF6600}/stop{FFFFFF} to stop the music");
}
case 2:
{
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/mnwozac2sp/Logic-_All_I_Do.mp3");
SendClientMessage(playerid, COLOR_WHITE, "Type {FF6600}/stop{FFFFFF} to stop the music");
}
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_MUSIC, DIALOG_STYLE_LIST, "Music", "English Songs \nHindi Songs", "Play", "Cancel");
}
return 1;
}
if(dialogid == DIALOG_MUSIC+2) //Hindi Songs
{
if(response)
{
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/hgkh82sfg1/CHEN-K_-_SOCH_Lyrics_Video_EXPLICIT_URDU_RAP.mp3");
SendClientMessage(playerid, COLOR_WHITE, "Type {FF6600}/stop{FFFFFF} to stop the music");
}
case 1:
{
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/i3rl0qgd9b/CHEN-K_-_NAAMCHOR_Official_Video_x_LYRIK_URDU_RAP.mp3");
SendClientMessage(playerid, COLOR_WHITE, "Type {FF6600}/stop{FFFFFF} to stop the music");
}
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_MUSIC, DIALOG_STYLE_LIST, "Music", "English Songs \nHindi Songs", "Play", "Cancel");
}
return 1;
}
if(dialogid == DIALOG_RADIO)
{
if(response)
{
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid, "http://7609.live.streamtheworld.com:80/977_HITS_SC");
SendClientMessage(playerid, COLOR_WHITE, "type {FF6600}/stop{FFFFFF} to stop the radio");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You've closed the Radio Dialog");
}
return 1;
}
if(dialogid == DIALOG_ADMIN) //Admin Control Panel
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_ADMIN+1, DIALOG_STYLE_LIST, "Weapons", "Minigun \nChainsaw \nMoltov \nJetpack", "Select", "Back");
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_ADMIN+2, DIALOG_STYLE_LIST, "Perks", "Health \nArmour", "Select", "Back");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You've closed the Admin Control Panel");
}
return 1;
}
if(dialogid == DIALOG_ADMIN+1) //Weapons
{
if(response)
{
switch(listitem)
{
case 0: // Minigun
{
GivePlayerWeapon(playerid, 38, 99999);
SendClientMessage(playerid, COLOR_WHITE, "* {66ffcc}Minigun has given to you!");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
case 1: //Chainsaw
{
GivePlayerWeapon(playerid, 9, 99999);
SendClientMessage(playerid, COLOR_WHITE, "* {66ffcc}Chainsaw has given to you!");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
case 2: //Moltov
{
GivePlayerWeapon(playerid, 18, 99999);
SendClientMessage(playerid, COLOR_WHITE, "* {66ffcc}Moltov has given to you!");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
case 3: //jetpack
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
SendClientMessage(playerid, COLOR_WHITE, "* {66ffcc}Jetpack has given to you!");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_LIST, "Admin Control Panel", "Weapons \nPerks", "Select", "Cancel");
}
return 1;
}
if(dialogid == DIALOG_ADMIN+2) //Perks
{
if(response)
{
switch(listitem)
{
case 0: //Health
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, COLOR_WHITE, "* {66ffcc}Your Health has been refilled");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
case 1: //Armour
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, COLOR_WHITE, "* {66ffcc}Your Armour has been refilled");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_LIST, "Admin Control Panel", "Weapons \nPerks", "Select", "Cancel");
}
return 1;
}
return 0;
}
i defined DIALOG_RADIO 1 because i put 1 stream on it