Radio Simple Question!
#1

how can i make it like i want to hear diffrent music in difrent location how can i do it??



PHP код:
public OnPlayerUpdate(playerid)
{
    if(!
IsPlayerConnected(playerid)) return 0;
    if(
IsPlayerNPC(playerid)) return 1;
    
// Handle playing SomaFM at the alhambra
    
if(GetPlayerInterior(playerid) == 0) {
        if(
IsPlayerInRangeOfPoint(playerid,70.0,251.5308,-1807.7228,7.8359)) { // Discoteca
            
if(!GetPVarInt(playerid,"alhambra")) {
                
SetPVarInt(playerid,"alhambra",1);
                
PlayAudioStreamForPlayer(playerid"http://srv2.radioboss.ro:8888",251.5308,-1807.7228,7.8359,70.0,true);
            }
        }
    }
    else {
        if(
GetPVarInt(playerid,"alhambra")) {
              
DeletePVar(playerid,"alhambra");
               
StopAudioStreamForPlayer(playerid);
        }
    }
    return 
1;

Reply
#2

I think there is a callback that is called when you enter an interior, I would use this one. Would be much better than using OnPlayerUpdate. I'd check the interiorID, if it's the alhambra, play the stream, if it's not, stop the stream.

Kinda easy, huh?
Reply
#3

i want so i do else you know andi want diffrent radio at a diffrent location you know..
Reply
#4

you just list all the different interior, use it like this,
pawn Код:
if(interiorid == alhambra)//change this to the real thing
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://srv2.radioboss.ro:8888");
}
else if(interiorid == gunshop){
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://www.yourcoolradiostation.com");
}
//here you list more interiors and radio stations you want
else StopAudioStreamForPlayer(playerid);//this means that you haven't listed a music station for that interior and it will stop
Hope it helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)