Вопросы

Подскажите пожалуйста как сделать чтоб радио было слышно для всех кто рядом с магнитофоном

 

if(dialogid == DIALOG_BOOMBOX)
    {
    	if(!response)
 	  	return 1;
		switch(listitem)
		{
 			case 0: PlayStream(playerid,"http://ep256.hostingradio.ru:8052/europaplus256.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
            case 1: PlayStream(playerid,"http://icecast.radiodfm.cdnvideo.ru/dfm.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
            case 2: PlayStream(playerid,"http://ic3.101.ru:8000/v1_1?setst=-1",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
            case 3: PlayStream(playerid,"http://air2.radiorecord.ru:805/rr_320",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
			case 4: PlayStream(playerid,"http://chanson.hostingradio.ru:8041/chanson256.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
			case 5: PlayStream(playerid,"http://stream.variant.fm:8000/LOVE-192",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
			case 6: ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_INPUT, !"Введите URL-адрес на свою музыку", !"{ffffff}Пожалуйста, вставьте ссылку на музыку для воспроизведения музыки\n Загрузить свою песню для получения ссылки можно сюда {00FF00}https://zaix.ru", !"Play", !"Отмена");
			case 7:
			{
                if(GetPVarInt(playerid, "BBArea"))
			    {
			        new string[128], pName[MAX_PLAYER_NAME];
			        GetPlayerName(playerid, pName, sizeof(pName));
					format(string, sizeof(string), "%s отключил магнитофон", GetName2(playerid));
					Do(playerid, string);
			        foreach(Player, i)
           			if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
		            StopStream(i);
			        DeletePVar(playerid, "BBStation");
				}
				SendClientMessage(playerid, COLOR_SYSTEM, !"Ты выключил свой магнитофон");
			}
        }
		return 1;
	}

 

По своей ссылке если врубать то работает 

if(dialogid == DIALOG_BOOMBOX2)//SET URL
        {
                if(response == 1)
                {
                    if(isnull(inputtext))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "Вы не ввели URL-адрес" );
                        return 1;
                    }
                    if(strlen(inputtext))
                    {
                                    foreach(Player, i)
                                        {
                                                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                                                {
                                                        PlayStream(i, inputtext, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                                                }
                                        }
                                        SetPVarString(playerid, "BBStation", inputtext);
                        }
                }

 

Поделиться сообщением


Ссылка на сообщение

4 ответа на этот вопрос

  • 0

PlayAudioStreamForPlayer

Пример 

for(new i; i< MAX_PLAYERS; i++) PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls", X, Y, Z, дистанция, 1);

 

Поделиться сообщением


Ссылка на сообщение
  • 0

Не могу как правильно прописать типо того

if(dialogid == DIALOG_BOOMBOX2)//SET URL
        {
                if(response == 1)
                {
                    if(strlen(inputtext))
                    {
                                    foreach(Player, i)
												{
														if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                                                        case 0: PlayStream(i,"http://ep256.hostingradio.ru:8052/europaplus256.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
														SetPVarString(playerid, "BBStation", "http://ep256.hostingradio.ru:8052/europaplus256.mp3");
                                                }
                                        }
                                        return 1;
									}

 

Поделиться сообщением


Ссылка на сообщение
  • 0

Ну вот прописал так но куча ошибок 
 

if(dialogid == DIALOG_BOOMBOX)
     if(response == 1)
     {
     		if(strlen(inputtext))
     	{
      		foreach(Player, i)
        	{
            	if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
 				PlayStream(i,"http://ep256.hostingradio.ru:8052/europaplus256.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
 				SetPVarString(playerid, "BBStation", "http://ep256.hostingradio.ru:8052/europaplus256.mp3");
 			}
 			foreach(Player, i)
 			{
				if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
  				PlayStream(i,"http://icecast.radiodfm.cdnvideo.ru/dfm.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
      			SetPVarString(playerid, "BBStation", "http://icecast.radiodfm.cdnvideo.ru/dfm.mp3");
			}
			foreach(Player, i)
			{
				if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
            	PlayStream(i,"http://ic3.101.ru:8000/v1_1?setst=-1",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
            	SetPVarString(playerid, "BBStation", "http://ic3.101.ru:8000/v1_1?setst=-1");
			}
			foreach(Player, i)
			{
			    if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
            	PlayStream(i,"http://air2.radiorecord.ru:805/rr_320",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
            	SetPVarString(playerid, "BBStation", "http://air2.radiorecord.ru:805/rr_320");
			}
			foreach(Player, i)
			{
			    if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
				PlayStream(i,"http://chanson.hostingradio.ru:8041/chanson256.mp3",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
				SetPVarString(playerid, "BBStation", "http://chanson.hostingradio.ru:8041/chanson256.mp3");
			}
			foreach(Player, i)
			{
				if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
			 	PlayStream(i,"http://stream.variant.fm:8000/LOVE-192",GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
			 	SetPVarString(playerid, "BBStation", "http://stream.variant.fm:8000/LOVE-192");
            }
			ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_INPUT, !"Введите URL-адрес на свою музыку", !"{ffffff}Пожалуйста, вставьте ссылку на музыку для воспроизведения музыки\n Загрузить свою песню для получения ссылки можно сюда {00FF00}https://zaix.ru", !"Play", !"Отмена");
			{
                if(GetPVarInt(playerid, "BBArea"))
			    {
			        new string[128], pName[MAX_PLAYER_NAME];
			        GetPlayerName(playerid, pName, sizeof(pName));
					format(string, sizeof(string), "%s отключил магнитофон", GetName2(playerid));
					Do(playerid, string);
			        foreach(Player, i)
           			if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
		            StopStream(i);
			        DeletePVar(playerid, "BBStation");
				}
				SendClientMessage(playerid, COLOR_SYSTEM, !"Ты выключил свой магнитофон");
			}
        }
		return 1;
	}

Ошибки

loose indentation

Строки

return 1;

При включении музыки все сразу начинают играть ужас. как сделать через case?

Отредактировано пользователем ОБКУРЕННЫЙ-КОТЭ

Поделиться сообщением


Ссылка на сообщение
  • 0

табуляция

 

 
switch(listitem)
{
    for(new i; i < MAX_PLAYERS; i++)
    case 0: PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls", X, Y, Z, дистанция, 1);
}

 

Поделиться сообщением


Ссылка на сообщение
Гость
Эта тема закрыта для публикации ответов.
  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

  • Похожий контент

    • Mister Odin
      От Mister Odin
       
      new
       g_teleport_list[39][E_TELEPORT_LIST] = {  {"Спавн пгт.Батырево", 1802.3612, 2508.4824, 15.8887},  {"Спавн г.Арзамас", -113.5887, 977.7222, 12.0346},     {"Спавн г.Южный", 2744.2770, -2446.7246, 21.8988},     {"Центральный банк", 1852.020385,2040.791381,15.892713},  {"Рублёвка", -837.7783, 888.6161, 12.7232},  {"Казино", 1332.4252, 2358.7014, 17.6641},  {"Битва за контейнеры", 614.5167, 1722.3566, 12.0709},  {"Автосалон низкого класса", 2493.9616, -722.9544, 12.3315},  {"Автосалон среднего класса", 1407.7449, 455.4801, 13.1630},  {"Автосалон высокого класса", -14.0637, 2614.5664, 10.9892},   {"Мотосалон Harley Davidson", 785.720153, 750.465087, 12.000024},  {"Автошкола", 1909.174438,2227.679687,15.708162},  {"Военкомат", 1916.778564,2302.411376,15.574637},  {"Правительство области", -139.140975,593.789611,12.145712},  {"Отдел полиции №1 (ГИБДД)", 1906.805786,-2234.382812,11.257631},  {"Отдел полиции №2 (УМВД)", 2581.309326,-2416.139892,21.960090},  {"Отдел ФСБ", 1823.904663,2095.636718,15.848405},  {"Городская больница г.Арзамас", -285.797210,581.851562,12.120290},   {"СМИ", -317.708038,821.221679,13.051450},  {"Воинская часть", 1703.197265,1678.025878,15.279437},  {"Арзамасская ОПГ", 438.705322,1046.505126,12.002637},  {"Батыревская ОПГ", 1941.203857,2161.006591,15.705187},  {"Лыткаринская ОПГ", -2346.002441,75.257041,21.002962},  {"Шахта", 2381.5727, 1726.4451, -2.1506},  {"Завод", -1062.6697, 2204.1894, 38.0964},  {"Инкосация", 1864.1374, 2011.7136, 15.8546},  {"Транспортная Компания", 2362.1115, 1972.5627, 15.5530},  {"База механиков", 1840.918090,-118.025146,15.695312},  {"Курьерская служба доставки", 2764.509765,-2396.882568,21.890625},  {"Аренда автобуса(Южный)", 2771.041992,-2454.780761,21.845964},  {"Аренда автобуса(Арзамас)", -127.487670,943.652648,12.142824},   {"Аренда автобуса(Батырево)", 1798.986328,2529.591552,15.664262},  {"Гоночная трасса", -1568.7784, 1611.8305, 36.3971},  {"Дом на горе", -789.5397, -456.7479, 741.1422},  {"СТО и тюнинг-ателье", 1856.1375, -122.3266, 15.6888},  {"Аренда транспорта пгт.Батырево", 1763.641723,2255.673339,15.865348},  {"Аренда транспорта г.Арзамас", -36.923530,1360.673583,12.002090},  {"Аренда транспорта г.Южный", 1966.599975,-2603.943603,10.820312},  {"Тайный интерьер в Лыткарино", -2424.5818, 2846.3291, 40.7908} };