Help with audio stream
#1

I want so they are inside the house heard the aduio stream but is not working whats the problem.

pawn Код:
if(PlayerInfo[playerid][pMaskuse] == 1)
                                {
                                    GetPlayerPos(giveplayerid,x,y,z);
                                    if(IsPlayerInRangeOfPoint(giveplayerid,10.0,x,y,z))
                                    PlayAudioStreamForPlayer(giveplayerid,"http://www.fileden.com/files/2012/4/18/3293679/Knocking%20on%20Wooden%20Door%20%20%20Sound%20Effect.mp3",x,y,z,distance,10);
                                    format(string, sizeof(string), "[DOOR] KNOCK!! KNOCK!! (([Stranger_%d]))", maskid);
                                    SendClientMessage(p, COLOR_PURPLE, string);
                                }
                                else
                                {
                                    GetPlayerPos(giveplayerid,x,y,z);
                                    if(IsPlayerInRangeOfPoint(giveplayerid,10.0,x,y,z))
                                    PlayAudioStreamForPlayer(giveplayerid,"http://www.fileden.com/files/2012/4/18/3293679/Knocking%20on%20Wooden%20Door%20%20%20Sound%20Effect.mp3",x,y,z,distance,10);
                                    format(string, sizeof(string), "[DOOR] KNOCK!! KNOCK!! ((%s))", GetPlayerNameEx(playerid));
                                    SendClientMessage(p, COLOR_PURPLE, string);
Reply
#2

1. The parameters for PlayAudioStreamForPlayer are (playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0) - you have the last one set to 10. It should be 1 if you want to play it at certain coordinates. However, I would just use playerid and url if I were you, there's no need to set the position!

2. You can't do

pawn Код:
if(something)
function();
function();
function();
you need to use brackets:
pawn Код:
if(something)
{
    function();
    function();
    function();
}
3. The URL is all messed up with %20 shit.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
1. The parameters for PlayAudioStreamForPlayer are (playerid, url[], FloatosX = 0.0, FloatosY = 0.0, FloatosZ = 0.0, Float:distance = 50.0, usepos = 0) - you have the last one set to 10. It should be 1 if you want to play it at certain coordinates. However, I would just use playerid and url if I were you, there's no need to set the position!

2. You can't do

pawn Код:
if(something)
function();
function();
function();
you need to use brackets:
pawn Код:
if(something)
{
    function();
    function();
    function();
}
3. The URL is all messed up with %20 shit.
The link working perfect.
Reply
#4

What do you mean with if(something), you should explain more
Reply
#5

Quote:
Originally Posted by MP2
Посмотреть сообщение
1. The parameters for PlayAudioStreamForPlayer are (playerid, url[], FloatosX = 0.0, FloatosY = 0.0, FloatosZ = 0.0, Float:distance = 50.0, usepos = 0) - you have the last one set to 10. It should be 1 if you want to play it at certain coordinates. However, I would just use playerid and url if I were you, there's no need to set the position!

2. You can't do

pawn Код:
if(something)
function();
function();
function();
you need to use brackets:
pawn Код:
if(something)
{
    function();
    function();
    function();
}
3. The URL is all messed up with %20 shit.
%20 specifies a space. Special characters use %ASCII-HEX.

Use

pawn Код:
PlayAudioStreamForPlayer(giveplayerid,"http://www.fileden.com/files/2012/4/18/3293679/Knocking%20on%20Wooden%20Door%20%20%20Sound%20Effect.mp3",x,y,z,distance,1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)