if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) // radiostations
{
new v;
v = GetPlayerVehicleID(playerid);
{
if(RadioPlaying[v] == 1)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
//Audio_PlayStreamed(playerid, "http://www.bum-files.com/internetradio/stations/rap-hip-hop1.asx", false, false, false);
Audio_PlayStreamed(playerid, "http://s15.myradiostream.com:10122/listen.pls", false, false, false);
ShowSubtitle(playerid, "Radio changed, now playing: Metal.", 1000, 1);
Audio_SetVolume(playerid, 1, RadioVolume[v]);
Audio_SetVolume(playerid, 2, RadioVolume[v]);
Audio_SetVolume(playerid, 3, RadioVolume[v]);
Audio_SetVolume(playerid, 4, RadioVolume[v]);
Audio_SetVolume(playerid, 5, RadioVolume[v]);
ListeningToRadio[playerid] = 1;
return 1;
}
else if(RadioPlaying[v] == 2)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
//Audio_PlayStreamed(playerid, "http://www.bum-files.com/internetradio/stations/top-hits1.asx", false, false, false);
Audio_PlayStreamed(playerid, "http://itori.animenfo.com:443/listen.pls", false, false, false);
ShowSubtitle(playerid, "Radio changed, now playing: AnimeNFO", 1000, 1);
Audio_SetVolume(playerid, 1, RadioVolume[v]);
Audio_SetVolume(playerid, 2, RadioVolume[v]);
Audio_SetVolume(playerid, 3, RadioVolume[v]);
Audio_SetVolume(playerid, 4, RadioVolume[v]);
Audio_SetVolume(playerid, 5, RadioVolume[v]);
ListeningToRadio[playerid] = 1;
return 1;
}
else if(RadioPlaying[v] == 3)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
//Audio_PlayStreamed(playerid, "http://www.reliastream.com/cast/tunein.php/niorozco/playlist.pls", false, false, false);
Audio_PlayStreamed(playerid, "http://67.213.213.143:8048/", false, false, false);
ShowSubtitle(playerid, "Radio changed, now playing: Hard Rock Heaven.", 1000, 1);
Audio_SetVolume(playerid, 1, RadioVolume[v]);
Audio_SetVolume(playerid, 2, RadioVolume[v]);
Audio_SetVolume(playerid, 3, RadioVolume[v]);
Audio_SetVolume(playerid, 4, RadioVolume[v]);
Audio_SetVolume(playerid, 5, RadioVolume[v]);
ListeningToRadio[playerid] = 1;
return 1;
}
else if(RadioPlaying[v] == 4)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
Audio_PlayStreamed(playerid, "http://174.36.206.217:8577/");
ShowSubtitle(playerid, "Radio changed, now playing: G'd Up Radio", 1000, 1);
Audio_SetVolume(playerid, 1, RadioVolume[v]);
Audio_SetVolume(playerid, 2, RadioVolume[v]);
Audio_SetVolume(playerid, 3, RadioVolume[v]);
Audio_SetVolume(playerid, 4, RadioVolume[v]);
Audio_SetVolume(playerid, 5, RadioVolume[v]);
ListeningToRadio[playerid] =1;
return 1;
}
//We set the radio to play here
}
}
CMD:radiostation(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new radiostation;
new carID;
new string[256];
carID = GetPlayerVehicleID(playerid);
if(!sscanf(params, "i", radiostation))
{
if(radiostation < 1 || radiostation > 4)
{
SendClientMessage(playerid, COLOR_LIGHTRED, " The radio station must be between 1 and 4!");
return 1;
}
else if(radiostation == 1)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
PlayAudioStreamForPlayer(playerid, "http://s15.myradiostream.com:10122/listen.pls");
//PlayAudioStreamForPlayer(playerid, "http://www.bum-files.com/internetradio/stations/rap-hip-hop1.asx");
RadioPlaying[carID] = radiostation;
ShowSubtitle(playerid, "Radio change, now playing Metal!.", 1000,1);
//ShowSubtitle(playerid, "Radio changed, now playing: 108 Jamz!.", 1000, 1);
//format(string, sizeof(string), "* %s changed the radio station to 108 Jamz.", PlayerNameEx(playerid));
format(string, sizeof(string), "* %s changed the radio station to Metal.", PlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ListeningToRadio[playerid] = 1;
return 1;
}
else if(radiostation == 2)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
PlayAudioStreamForPlayer(playerid, "http://itori.animenfo.com:443/listen.pls");
//PlayAudioStreamForPlayer(playerid, "http://www.bum-files.com/internetradio/stations/rap-hip-hop1.asx");
RadioPlaying[carID] = radiostation;
ShowSubtitle(playerid, "Radio change, now playing AnimeNFO.", 1000,1);
//ShowSubtitle(playerid, "Radio changed, now playing: 108 Jamz!.", 1000, 1);
//format(string, sizeof(string), "* %s changed the radio station to 108 Jamz.", PlayerNameEx(playerid));
format(string, sizeof(string), "* %s changed the radio station to AnimeNFO.", PlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ListeningToRadio[playerid] = 1;
return 1;
}
/*{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
PlayAudioStreamForPlayer(playerid, "http://tunein.com/radio/Hard-Rock-Heaven-s136514/");
//Audio_PlayStreamed(playerid, "http://www.bum-files.com/internetradio/stations/top-hits1.asx", false, false, false);
RadioPlaying[carID] = radiostation;
ShowSubtitle(playerid, "Radio changed, now playing: 80's Metal!....Or trying to.", 1000, 1);
//ShowSubtitle(playerid, "Radio changed, now playing: Top Hitz!.", 1000, 1);
//format(string, sizeof(string), "* %s changed the radio station to Top Hitz.", PlayerNameEx(playerid));
format(sting, sizeof(string), "* %s changed the radio station to 80's metal.", PlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ListeningToRadio[playerid] = 1;
return 1;
}*/
else if(radiostation == 3)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
PlayAudioStreamForPlayer(playerid, "http://67.213.213.143:8048/");
//Audio_PlayStreamed(playerid, "http://www.reliastream.com/cast/tunein.php/niorozco/playlist.pls", false, false, false);
RadioPlaying[carID] = radiostation;
ShowSubtitle(playerid, "Radio changed, now playing: Hard Rock Heaven.", 1000, 1);
format(string, sizeof(string), "* %s changed the radio station to the Hard Rock Heaven", PlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ListeningToRadio[playerid] = 1;
return 1;
}
else if(radiostation == 4)
{
Audio_Stop(playerid,1);
Audio_Stop(playerid,2);
Audio_Stop(playerid,3);
Audio_Stop(playerid,4);
Audio_Stop(playerid,5);
PlayAudioStreamForPlayer(playerid, "http://174.36.206.217:8577/");
RadioPlaying[carID] = radiostation;
ShowSubtitle(playerid, "Radio Changed, now playing: G'D UP RADIO", 1000, 1);
format(string, sizeof(string), "* %s changed the radio station to G'd Up Radio", PlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ListeningToRadio[playerid] =1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /radiostation [1-4]");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Lets you switch radio stations.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|____.:Radio Stations List:.______|");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Radio Station 1: {FFFFFF} Metal (for now)");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Radio Station 2: {FFFFFF} AnimeNFO");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Radio Station 3: {FFFFFF} Hard Rock Heaven");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Radio Station 4: {FFFFFF} G'd Up Radio");
return 1;
}
}
else
{
ShowSubtitle(playerid, "~r~You are not in a vehicle as a driver!.", 1000, 1);
}
return 1;
}
|
Where are you checking if the passengers are in the same vehicle as the driver?
|
IsPlayerInVehicle(i, vid)
|
Gonna need a loop for GetPlayerVehicleID. You'd actually need something like,
pawn Код:
|