How would one run an .mp3 with PlayAudioStreamForPlayer?
#1

I've seen on several servers people have the same song play upon logging in(that plays from start to end)


so instead of the PlayAudioStreamForPlayer url being an ip that just connects to a radio, how do I make a specific song play from start to end by each player?

Thanks!
Reply
#2

Код:
public OnPlayerConnect(playerid)
{
	PlayAudioStreamForPlayer(playerid,"URL.mp3 "); // plays the music when player connects
	return 1; // returns true. 
}
Код:
CMD:stopstream(playerid, params[])
{
    StopAudioStreamForPlayer(playerid); //Stops the music , just in case. 
    return 1; // returns true. 
}
Reply
#3

You need a link to that song to any web-server which supports the music streaming and you can store that link in a global string variable in your script, something like this.

Код:
new yourstr[] = "link here";
When ever you want to play the same song for anyone;
Код:
PlayAudioStreamForPlayer(playerid, yourstr);
Reply
#4

Thanks Tamy! repped[Tamy] ++;
Reply
#5

My mistake i've read it bad, here.
Код:
CMD:stream(playerid, params[])
{
    new string[128];
    if(isnull(params)) return SendClientMessage(playerid, LIGHT_RED, "USAGE: /stream [Url]");
    new HighestPlayerId = GetPlayerPoolSize();
for(new x=0; x <= HighestPlayerId; x++) {
        if(!IsPlayerConnected(x)) continue;
        format(string, sizeof(string), "%s(%d)Is streaming music", IsPlayerName(playerid), playerid);
    SendClientMessage(x, 0x00FFFFFF, string);
        PlayAudioStreamForPlayer(x, params);
    }
    }
return 1;
}
CMD:stopstream(playerid, params[])
{
    StopAudioStreamForPlayer(playerid);
    return 1;
}
Reply
#6

You can also point it to .pls playlists.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)