Вопросы

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

 

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 пользователей онлайн

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

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

    • Узбек
      От Узбек
      Всем добрый вечер ребят! 
      Я начинающий, сегодня я вам сливаю команду 2(шт) на технические работы
      Ловите 
       
    • nazpol9
      От nazpol9
      Привет всем.

      У меня имеется мод для самп сервера и VPS с Ubuntu, на котором я пытаюсь его запустить.

      В чем суть проблемы: при запуске samp03svr, сервер запускается, но на версии 0.3.DL R-1. Когда я пытаюсь запустить этот же мод локально на Windows, сервер работает на версии 0.3.7 и я могу зайти на него без клиента 0.3.DL.

      Для решения этой проблемы я уже пробовал заменять инклуды и исполнительные файлы теми, что есть в архивах на официальном сайте сампа, перекомпилировал мод, и ничего не изменилось.
       
      #include <a_samp> #include <a_mysql> #include <foreach> #include <Pawn.RakNet> #include <streamer> #include <sscanf2> #include <float2> #include <crashdetect> #include <fmt> #include <a_http> #include <Pawn.CMD> #include <Pawn.Regex> #include <requests> #include <callbacks> #include <MD5> #include <mxdate> #include <TOTP> #include <gvar> #include <md-sort> #include <nex-ac> #include <weapon-config> #include <discord-connector> #include <3DTryg> #include <textdraw-streamer>  
      plugins crashdetect.so streamer.so textdraw-streamer.so sscanf.so pawnraknet.so pawncmd.so mysql.so requests.so profiler.so pawnregex.so TOTP.so gvar.so discord-connector.so

      Если у кого-то будут какие-либо догадки, прошу ими поделиться, если понадобится больше информации - я постараюсь её предоставить.