Question

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

 

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);
                        }
                }

 

Share this post


Link to post

4 answers to this question

  • 0

PlayAudioStreamForPlayer

Пример 

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

 

Share this post


Link to post
  • 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;
									}

 

Share this post


Link to post
  • 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?

Edited by ОБКУРЕННЫЙ-КОТЭ

Share this post


Link to post
  • 0

табуляция

 

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

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content