Playing music for the server[rep+]
#5

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.
..
Reply


Messages In This Thread
Playing music for the server[rep+] - by Josh_Main - 05.06.2012, 07:54
Re: Playing music for the server[rep+] - by Firo - 05.06.2012, 07:56
Re: Playing music for the server[rep+] - by Aloushi - 05.06.2012, 07:57
Re: Playing music for the server[rep+] - by TzAkS. - 05.06.2012, 07:57
Re: Playing music for the server[rep+] - by Firo - 05.06.2012, 07:58
AW: Playing music for the server[rep+] - by Josh_Main - 05.06.2012, 08:02
Re: Playing music for the server[rep+] - by TzAkS. - 05.06.2012, 08:10
Re: AW: Playing music for the server[rep+] - by Aloushi - 05.06.2012, 08:14
AW: Playing music for the server[rep+] - by Josh_Main - 05.06.2012, 08:44
Re: AW: Playing music for the server[rep+] - by Firo - 05.06.2012, 08:47
Re: AW: Playing music for the server[rep+] - by Aloushi - 07.06.2012, 20:04
Re: Playing music for the server[rep+] - by Sandiel - 07.06.2012, 20:09

Forum Jump:


Users browsing this thread: 2 Guest(s)