cigarettes system!
#6

Try this:

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;
}
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.
Reply


Messages In This Thread
cigarettes system! - by «XTC» - 25.06.2012, 20:18
Re: cigarettes system! - by Kindred - 25.06.2012, 20:27
Re: cigarettes system! - by Face9000 - 25.06.2012, 20:28
Re: cigarettes system! - by «XTC» - 25.06.2012, 20:32
Re: cigarettes system! - by Face9000 - 25.06.2012, 20:34
Re: cigarettes system! - by Kindred - 25.06.2012, 20:35
Re: cigarettes system! - by «XTC» - 25.06.2012, 20:41
Re: cigarettes system! - by «XTC» - 25.06.2012, 20:54
Re: cigarettes system! - by SuperViper - 25.06.2012, 21:28
Re: cigarettes system! - by «XTC» - 25.06.2012, 21:34
Re: cigarettes system! - by «XTC» - 25.06.2012, 22:01
Re: cigarettes system! - by Kindred - 25.06.2012, 22:13
Re: cigarettes system! - by «XTC» - 25.06.2012, 22:27
Re: cigarettes system! - by «XTC» - 25.06.2012, 22:34
Re: cigarettes system! - by Steven82 - 26.06.2012, 04:21
Re: cigarettes system! - by «XTC» - 26.06.2012, 06:47

Forum Jump:


Users browsing this thread: 2 Guest(s)