Playing audio stream,based on url user enters
#1

How could this be made?
I tried to make something myself,but it doesn't work,it prints something like playing audio stream and it doesn't put the whole link.Just about half of it.
And it doesn't play anything too.
This is my code
Код:
CMD:deployradio (playerid, params[])
{
	new Float:X;
	new Float:Y;
	new Float:Z;
	GetPlayerPos(playerid, X, Y, Z);
	new songUrl[128];

	if (PRinfo[playerid][radioDeployed]==1)
	{
		SendClientMessage(playerid, 0xF0A20FFF, "Your radio is already deployed.");
	}
	else
	{
		new PName[MAX_PLAYER_NAME];
		new string[40];

		if(sscanf(params, "s", songUrl)) return SendClientMessage(playerid, 0xCFF0FFCF, "USAGE: /deployradio [SONG URL]");
		GetPlayerPos(playerid, X, Y, Z);
		PRinfo[playerid][radioDeployed]=1;
		SendClientMessage(playerid, 0xFFE2E817, "You have deployed your radio at your current position.");
		PRinfo[playerid][locX]=X+2;
		PRinfo[playerid][locY]=Y;
		PRinfo[playerid][locZ]=Z;
		GetPlayerName(playerid, PName, sizeof(PName));
		format(string, sizeof(string), "%s's radio is here", PName);
		radioDeployedLabel[playerid] = Create3DTextLabel(string, 0xFFF900FF, PRinfo[playerid][locX], PRinfo[playerid][locY], PRinfo[playerid][locZ], 35.0, 0, 0);
		radioObject[playerid] = CreateObject(2103, PRinfo[playerid][locX], PRinfo[playerid][locY], PRinfo[playerid][locZ]-1, 0.0, 0.0, 0.0);
		PlayAudioStreamForPlayer(playerid, songUrl, PRinfo[playerid][locX], PRinfo[playerid][locY], PRinfo[playerid][locZ], 20.0, 1);
		playerListeningRadio[playerid]=1;
		for (new i = 0;i<MAX_PLAYERS;i++)
		{
		    if (IsPlayerInRangeOfPoint(i, 10.0, PRinfo[playerid][locX], PRinfo[playerid][locY], PRinfo[playerid][locZ]) && i != playerid)
		    {
		        playerListeningRadio[i]=1;
		        PlayAudioStreamForPlayer(i, "http://mp3rehab.com/user_uploads_10813-12345/C.C.Catch%20-%20Backseat%20Of%20Your%20Cadillac.mp3", PRinfo[playerid][locX], PRinfo[playerid][locY], PRinfo[playerid][locZ], 10.0, 1);
		    }
		}
	}
	return 1;
}
Just ignore the rest of the code,it works fine,it's just a part of the command-the thing i'm trying to do.
It works when i put the link in the script,but i want it dynamic.
Reply


Messages In This Thread
Playing audio stream,based on url user enters - by Tagathron - 04.11.2013, 17:55
Re: Playing audio stream,based on url user enters - by Konstantinos - 04.11.2013, 18:04
Re: Playing audio stream,based on url user enters - by Tagathron - 04.11.2013, 18:14
Re: Playing audio stream,based on url user enters - by Tagathron - 04.11.2013, 18:27
Re: Playing audio stream,based on url user enters - by RayDcosta - 04.11.2013, 18:34
Re: Playing audio stream,based on url user enters - by Tagathron - 04.11.2013, 18:36

Forum Jump:


Users browsing this thread: 1 Guest(s)