PlayAudioStreamForPlayer problem
#1

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
Reply
#2

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
Reply
#3

Thanks man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)