Boombox in GM help
#1

Ok so I have a boombox script in my GM, it works awesome... except for one thing... If It's on and a player later connects they don't hear it. They only hear it if its truned on WHILE they are connected. How do I fix this so it plays when a player connects if it's on?

Here is the code (the song part isn't included. Ask if I need to give that too):
pawn Код:
if(strcmp(cmd, "/playradio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
        }
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[USAGE]:{FFFFFF} /playradio {009900}(on/off){FFFFFF}");
            return 1;
        }
        if(strcmp(tmp,"on",true) == 0)
        {
            if(PlayerInfo[playerid][pAdmin] == 1337)
            {
                ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
                playerBoombox[playerid] = CreateObject(2103, X, Y+1, Z, 1.5, 0.0, 0.0, 0.0);
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Los Santos Radio","Top Teen Radio\nTop Radio\nClassic Hits Radio\nRock Radio\nTop Teen Radio (ALL)\nTop Radio (ALL)\nChristmas Songs\nChristmas Songs (ALL)","Select","Cancel");        }
        }
        if(strcmp(tmp,"off",true) == 0)
        {
            if(PlayerInfo[playerid][pAdmin] == 1337)
            {
                DestroyObject(playerBoombox[playerid]);
                for(new i = 0; i < MAX_PLAYERS; i++)
                StopAudioStreamForPlayer(i);
            }
        }
        return 1;
    }
Thanks: jakejohnsonusa
Reply


Messages In This Thread
Boombox in GM help - by jakejohnsonusa - 18.11.2012, 15:06
Re: Boombox in GM help - by ikkentim - 18.11.2012, 15:16
Re: Boombox in GM help - by jakejohnsonusa - 18.11.2012, 15:47
Re: Boombox in GM help - by jakejohnsonusa - 18.11.2012, 16:06
Re: Boombox in GM help - by RACGaming - 18.11.2012, 16:13
Re: Boombox in GM help - by jakejohnsonusa - 18.11.2012, 16:24
Re: Boombox in GM help - by B-Matt - 18.11.2012, 16:46
Re: Boombox in GM help - by jakejohnsonusa - 18.11.2012, 17:00
Re: Boombox in GM help - by jakejohnsonusa - 18.11.2012, 17:05
Re: Boombox in GM help - by B-Matt - 19.11.2012, 06:18

Forum Jump:


Users browsing this thread: 1 Guest(s)