29.02.2012, 02:32 
	
	
	
		How do I get AudioStream to play for all?
	
	
	
	
| 
 [php] 
for(new i = 0;i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(i, "url"); }  | 
for(new i = 0; i < MAX_PLAYERS; i++)//loops through all players
{
if(IsPlayerConnected(i))//checks if player is connected
{
StopAudioStreamForPlayer(i);//stops the audio stream if any is playing.If none is playing nothing will happen.
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");//plays the music.U can put any link.Just change somafm.com/tags.pls
}
}
for(new i = 0; i < MAX_PLAYERS; i++)//loops through all players
{
   if(IsPlayerConnected(i))//checks if player is connected
   {
		if (PlayerInfo[playerid][pRadiouse] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_WHITE"Du har redan lagt ner en radio.");
		{
		 		new Float:Distance = 17.0;
				PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2147127", radioX[playerid], radioY[playerid], radioZ[playerid], Distance, 1);//plays the music.U can put any link.Just change somafm.com/tags.pls
			   	GetPlayerPos(playerid, radioX[playerid], radioY[playerid], radioZ[playerid]);
				GetPlayerFacingAngle(playerid, radioA[playerid]);
				boombox[playerid] = CreateObject(2103, radioX[playerid], radioY[playerid] +1, radioZ[playerid] -1, 0.0, 0.0, radioA[playerid] + 90);
				PlayerInfo[playerid][pRadiouse] = 1;
}
 			}
 			}
 			}
| 
 Not for me, I tested with 4 players that were connected, only id 0 hears the radio. Somethign wrong with the code I guess? 
 | 
for(new i = 0; i < MAX_PLAYERS; i++)//loops through all players
{
if(IsPlayerConnected(i))//checks if player is connected
{
StopAudioStreamForPlayer(i);//stops the audio stream if any is playing.If none is playing nothing will happen.
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");//plays the music.U can put any link.Just change somafm.com/tags.pls
}
}
PlayAudioStreamForPlayer(i,"your audio link");
StopAudioStreamForPlayer(i))
for(new i = 0; i < MAX_PLAYERS; i++)
}