SA-MP Forums Archive
Playing music for the server[rep+] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Playing music for the server[rep+] (/showthread.php?tid=348367)



Playing music for the server[rep+] - Josh_Main - 05.06.2012

I know how to play music for the whole server, but whenever i put a link in, the audio stream pops up in game but it doesnt play. i think its because its a ******* link not a .pls. How can i get a song in My Music to covert to .pls so i can play it?

Thanks heaps


Re: Playing music for the server[rep+] - Firo - 05.06.2012

******* can not played on SA-MP.

Use this website - http://kiwi6.com/
Upload your music then use the direct hot link and paste it in the function.

Example i find to the direct hotlink place - http://i.imgur.com/Fnm6V.png
Have fun.


Re: Playing music for the server[rep+] - Aloushi - 05.06.2012

Quote:
Originally Posted by Josh_Main
View Post
I know how to play music for the whole server, but whenever i put a link in, the audio stream pops up in game but it doesnt play. i think its because its a ******* link not a .pls. How can i get a song in My Music to covert to .pls so i can play it?

Thanks heaps
Code:
//-------------------------------------------------
// Internet radio example
// © 2011 SA-MP Team
//-------------------------------------------------

#pragma tabsize 0
#include <a_samp>

//-------------------------------------------------

public OnFilterScriptInit()
{
	return 1;
}

//-------------------------------------------------

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	// play an internet radio stream when they are in a vehicle
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls"); // set the wet site here for you song
	}
	// stop the internet stream
	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
	    StopAudioStreamForPlayer(playerid);
	}
	return 0;
}

//-------------------------------------------------

public OnPlayerUpdate(playerid)
{
	if(!IsPlayerConnected(playerid)) return 0;
	if(IsPlayerNPC(playerid)) return 1;
	
	// Handle playing SomaFM at the alhambra
	if(GetPlayerInterior(playerid) == 17) {
	    if(IsPlayerInRangeOfPoint(playerid,70.0,489.5824,-14.7563,1000.6797)) { // alhambra middle
	    	if(!GetPVarInt(playerid,"alhambra")) {
	    	    SetPVarInt(playerid,"alhambra",1);
	    	    PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",480.9575,-3.5402,1002.0781,40.0,true);
			}
		}
	}
	else {
		if(GetPVarInt(playerid,"alhambra")) {
	  		DeletePVar(playerid,"alhambra");
	   		StopAudioStreamForPlayer(playerid);
		}
	}
	
	return 1;
}
this is iradio filterscript you can play song by set the wepsite


Re: Playing music for the server[rep+] - TzAkS. - 05.06.2012

Try this

https://sampforum.blast.hk/showthread.php?tid=290595


Re: Playing music for the server[rep+] - Firo - 05.06.2012

Quote:
Originally Posted by Aloushi
View Post
Code:
//-------------------------------------------------
// Internet radio example
// © 2011 SA-MP Team
//-------------------------------------------------

#pragma tabsize 0
#include <a_samp>

//-------------------------------------------------

public OnFilterScriptInit()
{
	return 1;
}

//-------------------------------------------------

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	// play an internet radio stream when they are in a vehicle
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls"); // set the wet site here for you song
	}
	// stop the internet stream
	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
	    StopAudioStreamForPlayer(playerid);
	}
	return 0;
}

//-------------------------------------------------

public OnPlayerUpdate(playerid)
{
	if(!IsPlayerConnected(playerid)) return 0;
	if(IsPlayerNPC(playerid)) return 1;
	
	// Handle playing SomaFM at the alhambra
	if(GetPlayerInterior(playerid) == 17) {
	    if(IsPlayerInRangeOfPoint(playerid,70.0,489.5824,-14.7563,1000.6797)) { // alhambra middle
	    	if(!GetPVarInt(playerid,"alhambra")) {
	    	    SetPVarInt(playerid,"alhambra",1);
	    	    PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",480.9575,-3.5402,1002.0781,40.0,true);
			}
		}
	}
	else {
		if(GetPVarInt(playerid,"alhambra")) {
	  		DeletePVar(playerid,"alhambra");
	   		StopAudioStreamForPlayer(playerid);
		}
	}
	
	return 1;
}
this is iradio filterscript you can play song by set the wepsite
He said he know how to use but he don't know where he can upload the music.
..


AW: Playing music for the server[rep+] - Josh_Main - 05.06.2012

Thanks guys repped you all up!

@TzAkS, the ******* player that guy created, doesnt work in 0.3e i dont think.


Re: Playing music for the server[rep+] - TzAkS. - 05.06.2012

Try it :P


Re: AW: Playing music for the server[rep+] - Aloushi - 05.06.2012

Quote:
Originally Posted by Josh_Main
View Post
Thanks guys repped you all up!

@TzAkS, the ******* player that guy created, doesnt work in 0.3e i dont think.
lol you cant rep you need to be more than post 50 to rep


dont forget me


AW: Playing music for the server[rep+] - Josh_Main - 05.06.2012

huh? well whenever i click rep it says ''thank you for adding to '' ...'' reputation.


Re: AW: Playing music for the server[rep+] - Firo - 05.06.2012

Quote:
Originally Posted by Josh_Main
View Post
huh? well whenever i click rep it says ''thank you for adding to '' ...'' reputation.
Yes but we'll get the reputation when you'll reach 50 posts.


Re: AW: Playing music for the server[rep+] - Aloushi - 07.06.2012

Quote:
Originally Posted by Josh_Main
View Post
huh? well whenever i click rep it says ''thank you for adding to '' ...'' reputation.
no rep added it said but cant look my rep the same you need 50 post test it


Re: Playing music for the server[rep+] - Sandiel - 07.06.2012

You need a link of a song ending with .mp3
Best place to find these: beemp3.com
Just search for the song, and copy the MP3 link found in there.