Boombox problem.. Help.
#8

Bump! Update: After changing the script many times and resulting in problems, this is what I've got now! (Code above only played for the player who placed the Boombox)

pawn Код:
forward BoomboxPlay();
public BoomboxPlay()
{
    foreach(Player, i)
    {
        foreach(Player, x)
        {
            if(IsPlayerInRangeOfPoint(i, 35.0, BoomboxPosition[x][0], BoomboxPosition[x][1],BoomboxPosition[x][2]))
            {
                if(IsPlayerInAnyVehicle(i)) return 1;
                if(BoomboxListen[i] != BoomboxStation[x])
                {
                    new station[64];
                    switch(BoomboxStation[x])
                    {
                        case 1:
                        {
                            format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
                            BoomboxListen[i] = 1;
                        }
                        case 2:
                        {
                            format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
                            BoomboxListen[i] = 2;
                        }
                        case 3:
                        {
                            format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283896");
                            BoomboxListen[i] = 3;
                        }
                        case 4:
                        {
                            format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366&");
                            BoomboxListen[i] = 4;
                        }
                        case 5:
                        {
                            format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=663859&");
                            BoomboxListen[i] = 5;
                        }
                        case 6:
                        {
                            format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516&");
                            BoomboxListen[i] = 6;
                        }
                    }
                    PlayAudioStreamForPlayer(i, station, BoomboxPosition[x][0], BoomboxPosition[x][1],BoomboxPosition[x][2], 35, 1); // Play the stream.
                }
            }
            else
            {
                if(BoomboxListen[i] > 0)
                {
                    BoomboxListen[i] = 0;
                    StopAudioStreamForPlayer(i);
                }
            }
        }
    }
    return 1;
}
This code only plays when one person is online and spams audio when more than one person is online, cannot figure out how to fix it!
Reply


Messages In This Thread
Boombox problem.. Help. - by ryansheilds - 06.06.2012, 16:12
Re: Boombox problem.. Help. - by San1 - 06.06.2012, 16:29
Re: Boombox problem.. Help. - by ryansheilds - 06.06.2012, 16:32
Re: Boombox problem.. Help. - by ryansheilds - 07.06.2012, 20:39
Re: Boombox problem.. Help. - by nickdodd25 - 07.06.2012, 21:27
Re: Boombox problem.. Help. - by kaisersouse - 07.06.2012, 21:34
Re: Boombox problem.. Help. - by ryansheilds - 07.06.2012, 22:51
Re: Boombox problem.. Help. - by ryansheilds - 10.06.2012, 19:27

Forum Jump:


Users browsing this thread: 2 Guest(s)