Всем привет! решил сделать команду для проигрывания музыки в машине. при вводе команды перед вами появляется диалог с выбором жанра музыки. Вот сама команда
PHP код:
else if(strcmp(cmd, "/radon", true)==0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Вы не в машине!");
SPD(playerid,1338,DIALOG_STYLE_LIST,"Night Life Radio","1.Rock Radio\n 2.Dubstep Radio\n 3.Hip-Hop Radio\n 4.Reggae Radio\n 5.Country Radio\n 6.Jazz Radio","Выбрать","Отмена");
return 1;
}
PHP код:
case 1338:
{
if(!response) return 1;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Вы не в машине!");
if(response)
{
if(listitem == 0)
{
SPD(playerid,1339,DIALOG_STYLE_LIST,"Night Life Rock Radio","1.Wild Rock Radio\n 2.Death Metal\n 3.Trash Metal\n 4.Heavy Metal\n 5.Black Metal\n 6.AC|DC","Выбрать","Отмена");
}
else if(listitem == 1)
{
SendClientMessage(playerid, COLOR_GREEN,"Вы подключились к Dubthugz Radio");
PlayAudioStreamForPlayer(playerid, "http://uk1.internet-radio.com:15634");
}
else if(listitem == 2)
{
SendClientMessage(playerid, COLOR_GREEN,"Вы подключились к Smooth Beats Radio");
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8024");
}
else if(listitem == 3)
{
SendClientMessage(playerid, COLOR_GREEN,"Вы подключились к La Grosse Radio");
PlayAudioStreamForPlayer(playerid, "http://hd2.lagrosseradio.info:8300");
}
else if(listitem == 4)
{
SendClientMessage(playerid, COLOR_GREEN,"Вы подключились к Country•108 Radio");
PlayAudioStreamForPlayer(playerid, "http://tuner.country108.com:80");
}
else if(listitem == 5)
{
SendClientMessage(playerid, COLOR_GREEN,"Вы подключились к Smooth Jazz Radio");
PlayAudioStreamForPlayer(playerid, "http://sj256.hnux.com");
}
return 1;
}
}
PHP код:
case 1339:
{
if(!response) return 1;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Вы не в машине!");
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"Вы подключились к Wild Rock Radio");
PlayAudioStreamForPlayer(playerid, "http://69.64.92.79:8231/stream");
}
else if(listitem == 1)
{
SendClientMessage(playerid,COLOR_GREEN,"Вы подключились к Radio Death Metal");
PlayAudioStreamForPlayer(playerid, "http://72.26.204.28:9524/");
}
else if(listitem == 2)
{
SendClientMessage(playerid,COLOR_GREEN,"Вы подключились к Radio Trash Metal");
PlayAudioStreamForPlayer(playerid, "http://72.26.204.28:9704/");
}
else if(listitem == 3)
{
SendClientMessage(playerid,COLOR_GREEN,"Вы подключились к Radio Heavy Metal Metal");
PlayAudioStreamForPlayer(playerid, "http://72.26.204.28:9464/");
}
else if(listitem == 4)
{
SendClientMessage(playerid,COLOR_GREEN,"Вы подключились к Radio Black Metal");
PlayAudioStreamForPlayer(playerid, "http://72.26.204.28:9544/");
}
else if(listitem == 5)
{
SendClientMessage(playerid,COLOR_GREEN,"Вы подключились к Radio Sen| AC|DC");
PlayAudioStreamForPlayer(playerid, "http://server-uk1.radioseninternetuy.com:8006");
}
return 1;
}
}
Для выключения музыки
PHP код:
else if(strcmp(cmd, "/radoff", true)==0)
{
StopAudioStreamForPlayer(playerid);
return 1;
}