SA-MP Forums Archive
PlayAudioStreamForPlayer problem - 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: PlayAudioStreamForPlayer problem (/showthread.php?tid=445830)



Small problem - Josh_Main - 23.06.2013

Hello, I created a simple audio stream script so music can be streamed outside of my VIP club, but when I enter the area, I don't see "audio stream: blah blah" or I don't here anything. Does anyone know the problem?

Here is my code:

Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid,40, 1506.9310,-1296.2416,14.2828))
 {
	    if(GetPVarInt(playerid, "spawn"))
		{
		    SetPVarInt(playerid,"spawn",1);
		    PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",1506.9310,-1296.2416,14.2828,40,1);
		}
	}
	else
	{
	    if(GetPVarInt(playerid, "spawn"))
	    {
	    DeletePVar(playerid, "spawn");
	    StopAudioStreamForPlayer(playerid);
	}
}
	return 1;
	}
Thanks in advanced


Re: PlayAudioStreamForPlayer problem - IRio97 - 23.06.2013

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,40, 1506.9310,-1296.2416,14.2828))
    {
        if(GetPVarInt(playerid, "spawn") == 0)
        {
            SetPVarInt(playerid,"spawn",1);
            PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",1506.9310,-1296.2416,14.2828,40,1);
        }
    }
    else
    {
        if(GetPVarInt(playerid, "spawn") == 1)
        {
            DeletePVar(playerid, "spawn");
            StopAudioStreamForPlayer(playerid);
        }
    }
    return 1;
}
Remember to put:
pawn Код:
SetPVarInt(playerid, "spawn" , 0);
in OnPlayerSpawn or in OnPlayerConnect


Re: PlayAudioStreamForPlayer problem - Josh_Main - 23.06.2013

Thanks man!