К всем new добавим:
Код
new bool:Logged[MAX_PLAYERS];
Ко всем команда добавим:
Код
if(strcmp(cmd, "/play", true) == 0)
{
if(Logged[playerid] == true)
{
if(GetPVarInt(playerid, "InternetRadioEnabled"))
{
SetPVarInt(playerid, "InternetRadioEnabled", false);
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid,0xFF9900AA, "Online радио отключено.");
}
else
{
ShowPlayerDialog(playerid,1580,DIALOG_STYLE_LIST,"{00cc00}Online радио","{ffffff}1. DFM\n2. Авторадио\n3. Радио шансон\n4. Radio Rock\n5. Radio Record","Выбрать","Закрыть");
}
}
return true;
}
Ко всем диалогам добавим:
Код
if(dialogid == 1580)
{
if(response)
{
if(listitem == 0)
{
PlayAudioStreamForPlayer(playerid, "http://pub3.di.fm:80/di_clubsounds");
SetPVarInt(playerid, "InternetRadioEnabled", true);
SendClientMessage(playerid,0x00cc00AA, "Online радио включено.");
}
if(listitem == 1)
{
PlayAudioStreamForPlayer(playerid, "http://stream02.media.rambler.ru/auto128.mp3");
SetPVarInt(playerid, "InternetRadioEnabled", true);
SendClientMessage(playerid,0x00cc00AA, "Online радио включено.");
}
if(listitem == 2)
{
PlayAudioStreamForPlayer(playerid, "http://radiostream.akado.ru/playlist/radio.m3u?station=shanson&stream=128");
SetPVarInt(playerid, "InternetRadioEnabled", true);
SendClientMessage(playerid,0x00cc00AA, "Online радио включено.");
}
if(listitem == 3)
{
PlayAudioStreamForPlayer(playerid, "http://81.19.85.204/rock128.mp3");
SetPVarInt(playerid, "InternetRadioEnabled", true);
SendClientMessage(playerid,0x00cc00AA, "Online радио включено.");
}
if(listitem == 4)
{
PlayAudioStreamForPlayer(playerid, "http://stream.radiorecord.ru:8100/rr_aac");
SetPVarInt(playerid, "InternetRadioEnabled", true);
SendClientMessage(playerid,0x00cc00AA, "Online радио включено.");
}
}
}
Автор: Cesare228