Radio on Stage - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Radio on Stage (
/showthread.php?tid=406030)
Radio on Stage -
Akcent_Voltaj - 08.01.2013
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", 1000, 1);
Re: Radio on Stage -
park4bmx - 08.01.2013
Your timer needs to pass the variable "playerid"in order for to work properly.
That is done by using
SetTimerEx
Re: Radio on Stage -
Akcent_Voltaj - 08.01.2013
radioscenaTimer = SetTimerEx("RadioScena", 1000, 1); like this??
Re: Radio on Stage -
RedCrossER - 08.01.2013
No you have to Pass the Player I'd
Re: Radio on Stage -
Akcent_Voltaj - 08.01.2013
how?what do you mean
Re: Radio on Stage -
Akcent_Voltaj - 08.01.2013
please i tried to put it SetTimerEx and no work..
Re: Radio on Stage -
Akcent_Voltaj - 09.01.2013
anyone helping...wow last post was yesterday..no spam..
Re: Radio on Stage -
park4bmx - 09.01.2013
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);
Re: Radio on Stage -
Akcent_Voltaj - 09.01.2013
thats what im saying no work...i cant hear no music..
Re: Radio on Stage -
LetsOWN[PL] - 09.01.2013
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