13.08.2012, 03:12
Код:
#include <a_samp>
#if defined FILTERSCRIPT
#define COL_RED 0xFF0000FF
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/radio",cmdtext,true,10) == 0)
{
ShowPlayerDialog(playerid, 90, DIALOG_STYLE_LIST,""COL_RED"Radio 1",""COL_RED"Radio Off","Ok","Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem inputtext[])
{
switch(dialogid)
{
case 90:
{
if(!response)
{
SendClientMessage(playerid, COL_RED, "You cancelled!");
return 1;
}
switch(listitem)
{
case 0
{
PlayAudioStreamForPlayer(playerid, "http://www.bbc.co.uk/radio/player/bbc_radio_one");
SendClientMessage(playerid, COL_RED, "You're playing Radio 1");
}
case 1
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COL_RED, "You have turned the Radio off!");
}
}
}
}
return 1;
}
#endif

