boombox help?
#1

Got i problem with my boombox only the person who placed the boombox can hear the music why?


pawn Код:
}
    if(dialogid == 761)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    new Float:x, Float:y, Float:z,Float:distance = 20.0;
                    GetPlayerPos(playerid, x, y, z);
                    foreach(Player, i)
                    {
                        if(IsPlayerInRangeOfPoint(playerid,20.0,x,y,z))
                        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/5hg5uq0p9u/mange_makers_mange_bjuder_official_video.mp3",x,y,z,distance,1);
                    }
                }
            }
        }
        return 1;
pawn Код:
CMD:placeboombox(playerid, params[])
{
    if (PlayerInfo[playerid][pAdministrator] == 4)
    {
        new string[128];
        GetPlayerPos(playerid,Positions[0][0], Positions[0][1], Positions[0][2]);
        SetPVarFloat(playerid, "DYN_Boombox_FLOAT_X", Positions[0][0]);
        SetPVarFloat(playerid, "DYN_Boombox_FLOAT_Y", Positions[0][1]);
        SetPVarFloat(playerid, "DYN_Boombox_FLOAT_Z", Positions[0][2]);
        PlayerInfo[playerid][pBoombox] = CreateDynamicObject(2103, Positions[0][0], Positions[0][1], Positions[0][2]-0.9, 0, 0, 3.9700012207031);
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
        format(string, sizeof(string), "%s's boombox\n{FF0000}/setboombox {FFFF00}or\n{FF0000}/destroyboombox", GetPlayerNameEx(playerid));
        ShowPlayerDialog(playerid, 761, DIALOG_STYLE_LIST, "Welcome to Ammunation", "Fest hos mange", "Play", "Cancel");
        SendClientMessage(playerid, COLOR_YELLOW, "You have placed Boombox on the ground, /pickupboombox to remove it.");
    }
    return 1;
}
Reply
#2

Код:
foreach(Player, i)
{
    PlayAudioStreamForPlayer(i,"http://k003.kiwi6.com/hotlink/5hg5uq0p9u/mange_makers_mange_bjuder_official_video.mp3",x,y,z,distance,1);
}
Reply
#3

Код:
foreach(Player, i)
{                     
    PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/5hg5uq0p9u/mange_makers_mange_bjuder_official_video.mp3",x,y,z,distance,1);
}
Why "playerid" ? If you use foreach you need to type that value what you wrote on foreach(Player, i).


Changed your code with this:
Код:
foreach(Player, i)
{                     
    PlayAudioStreamForPlayer(i,"http://k003.kiwi6.com/hotlink/5hg5uq0p9u/mange_makers_mange_bjuder_official_video.mp3",x,y,z,distance,1);
}
No must work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)