12.04.2013, 00:58
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..
Is there any way to make the dialogs not spend un-necesary code needed? I want to short it up.
Код:
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; }
Код:
Example if(response) { case 0: return SendClientMessage(playerid, COLOR_RED, "BLA!"); return 1; }