PlayAudioStreamForPlayer help
#1

I want so everyone around the area can hear this right now is only me?

pawn Код:
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
                    GetPlayerPos(playerid, X, Y, Z);
                    PlayAudioStreamForPlayer(playerid, "http://www.fileden.com/files/2012/4/18/3293679/Sound%20Car%20alarm%20%28Alarma%20de%20coche%29.mp3", X, Y, Z, Distance, 0);
Reply
#2

here you go, im not sure if it will work but still am pretty sure so give it a try

pawn Код:
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 5.0,X, Y, Z))
{
PlayAudioStreamForPlayer(playerid,       "http://www.fileden.com/files/2012/4/18/3293679/Sound%20Car%20alarm%20%28Alarma%20de%20coche%29.mp3", X, Y, Z, Distance, 0);
}
Reply
#3

Still same problem x)
Reply
#4

Then use
pawn Код:
IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:X, Float:Y, Float:Z;

    GetPlayerPos(playerid, X, Y, Z);
    if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
        return 1;
    }
    return 0;
}

new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInArea(playerid, 5.0,X, Y, Z))
{
PlayAudioStreamForPlayer(playerid,       "http://www.fileden.com/files/2012/4/18/3293679/Sound%20Car%20alarm%20%28Alarma%20de%20coche%29.mp3", X, Y, Z, Distance, 0);
}
Reply
#5

no return value i where are u putting this?
Reply
#6

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z)) PlayAudioStreamForPlayer(i, "http://www.fileden.com/files/2012/4/18/3293679/Sound%20Car%20alarm%20%28Alarma%20de%20coche%29.mp3", X, Y, Z, 5.0, 0);
    }
}
X, Y, Z is the position where the player has to be in order to hear the sound, right?
Reply
#7

If you want onplayerconnect u can use simply:
pawn Код:
{
PlayAudioStreamForPlayer(playerid,URL);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)