Radio
#1

Hello guys, well is there any way to shorten the script? I mean the dialogs, it's annoying that I have to put for each one like this..
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 90: 
            if(!response)
            {
                    SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
                    return 1;
            }

            switch(listitem)
            {
                case 0:
                {
                    PlayAudioStreamForPlayer(playerid, "http://radio02-cn3.akadostream.ru:8814/nrj192.mp3");
                    SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming."); 
                }
                case 1:
                {
                    PlayAudioStreamForPlayer(playerid, "http://stream.radioactivity.fm:8002/");
                    SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");
                }
            }
        }
    }
    return 1;
}
Is there any way to make the dialogs not spend un-necesary code needed? I want to short it up.

Код:
Example
if(response)
	    {
	        case 0: return SendClientMessage(playerid, COLOR_RED, "BLA!");
	        return 1;
		}
Reply


Messages In This Thread
Radio - by Pawnie - 12.04.2013, 00:58
Re: Radio - by BittleRyan - 12.04.2013, 01:35
Re: Radio - by Pawnie - 12.04.2013, 01:39
Re: Radio - by BittleRyan - 12.04.2013, 01:48
Re: Radio - by Pawnie - 12.04.2013, 02:16

Forum Jump:


Users browsing this thread: 1 Guest(s)