25.06.2012, 20:35
Try this:
Pretty obvious.
PS: Above post, I lol'ed when you said tons of case 1's. There are 3. If you looked at them, you could see which one was the problem.
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
case 1:
{
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid,"http://listen.di.fm/public5/trance.asx",0.0, 0.0, 0.0, 50.0, 0);
CreateBox(playerid, "Radio", "~r~Trance music ~w~radio activated!");
}
case 1:
{
PlayAudioStreamForPlayer(playerid, "http://listen.di.fm/public5/harddance.asx", 0.0, 0.0, 0.0, 50.0, 0);
CreateBox(playerid, "Radio", "~r~hard dance music ~w~radio activated!");
}
case 2:
{
PlayAudioStreamForPlayer(playerid, "http://listen.di.fm/public5/dubstep.asx", 0.0, 0.0, 0.0, 50.0, 0);
CreateBox(playerid, "Radio", "~r~Dubstep music ~w~radio activated!");
}
case 3:
{
PlayAudioStreamForPlayer(playerid, "http://listen.di.fm/public5/djmixes.asx", 0.0, 0.0, 0.0, 50.0, 0);
CreateBox(playerid, "Radio", "~r~DJ mixes music ~w~radio activated!");
}
case 4:
{
StopAudioStreamForPlayer(playerid);
CreateBox(playerid, "Radio", "~r~Radio ~w~have been stopped!");
}
}
}
case 2:
{
switch(listitem)
{
case 1:
{
if(GetPlayerMoney(playerid) < 10) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Esse Black cigarette!", "Okay", "Close");
GivePlayerMoney(playerid, -10);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
}
case 2:
{
if(GetPlayerMoney(playerid) < 10) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy G1 cigarette!", "Okay", "Close");
GivePlayerMoney(playerid, -10);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
}
case 3:
{
if(GetPlayerMoney(playerid) < 5) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Macbeth cigarette!", "Okay", "Close");
GivePlayerMoney(playerid, -5);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
}
case 4:
{
if(GetPlayerMoney(playerid) < 20) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Malboro cigarette!", "Okay", "Close");
GivePlayerMoney(playerid, -20);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
}
case 5:
{
if(GetPlayerMoney(playerid) < 50) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Winstone Light cigarette!", "Okay", "Close");
GivePlayerMoney(playerid, -50);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
}
case 6:
{
if(GetPlayerMoney(playerid) < 200000) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Nicotine Sticks!", "Okay", "Close");
GivePlayerMoney(playerid, -200000);
SetPlayerDrunkLevel(playerid, 0);
}
}
}
}
return 1;
}
PS: Above post, I lol'ed when you said tons of case 1's. There are 3. If you looked at them, you could see which one was the problem.