Radio on Stage
#1

only id 0 can hear music..please help!!

pawn Код:
forward RadioScena(playerid);
                    public RadioScena(playerid) // scena - stage..
                    {
                    if(IsPlayerInRangeOfPoint(playerid,50.0,251.5308,-1807.7228,7.8359))
                    {
                    if(!GetPVarInt(playerid,"muzica"))
                    {
                    SetPVarInt(playerid,"muzica",1);
                    PlayAudioStreamForPlayer(playerid, "http://live128.radioprob.ro:9999/",251.5308,-1807.7228,7.8359, 80.0,true); //
                    }  //http://radio-crazy.is-a-chef.com:8024/
                    }
                    else
                    {
                    if(GetPVarInt(playerid,"muzica"))
                    {
                    DeletePVar(playerid,"muzica");
                    StopAudioStreamForPlayer(playerid);
                    }
                    }
                    return 1;
                    }
PHP код:
radioscenaTimer SetTimer("RadioScena"10001); 
Reply
#2

Your timer needs to pass the variable "playerid"in order for to work properly.
That is done by using SetTimerEx
Reply
#3

radioscenaTimer = SetTimerEx("RadioScena", 1000, 1); like this??
Reply
#4

No you have to Pass the Player I'd
Reply
#5

how?what do you mean
Reply
#6

please i tried to put it SetTimerEx and no work..
Reply
#7

anyone helping...wow last post was yesterday..no spam..
Reply
#8

pawn Код:
//correct the variable first as you cant use it global !
new radioscenaTimer[MAX_PLAYERS];
//then later on
radioscenaTimer[playerid] = SetTimerEx("RadioScena", 1000, true,"i",playerid);
Reply
#9

thats what im saying no work...i cant hear no music..
Reply
#10

pawn Код:
#define On 0
#define Off 1
// ^^^ - on top
// and this code below can be placed literally anywhere
stock RadioScena(_toggle = On)
{
    for(new playerid = 0; playerid != MAX_PLAYERS; playerid++){
        if(IsPlayerInRangeOfPoint(playerid,50.0,251.5308,-1807.7228,7.8359))
        {
            if(_toggle == On)
            {
                PlayAudioStreamForPlayer(playerid, "http://live128.radioprob.ro:9999/",251.5308,-1807.7228,7.8359, 80.0,true); //
            }  //http://radio-crazy.is-a-chef.com:8024/
        }
        else
        {
            if(_toggle == Off)
            {
                StopAudioStreamForPlayer(playerid);
            }}}
    return 1;
}

COMMAND:radioon(playerid, params[])
{
    RadioScena(On);
    return 1;
}

COMMAND:radiooff(playerid, params[])
{
    RadioScena(Off);
    return 1;
}
Greetz,
LetsOWN
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)