Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ____________________
- | Car Radio System |
- | Credits: Benjamin |
- | @ 2017 FilterScript|
- |____________________|
- */
- #include <a_samp>
- #define DIALOG_RADIO 500
- new CarRadio[MAX_VEHICLES];
- #define FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Radio System by Benjamin");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_ONFOOT)
- {
- StopAudioStreamForPlayer(playerid);
- }
- if(newstate == PLAYER_STATE_DRIVER)
- {
- if(CarRadio[vehicleid] == 1)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
- }
- else if(CarRadio[vehicleid] == 2)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
- }
- else if(CarRadio[vehicleid] == 3)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.radiozu.ro:8020");
- }
- else if(CarRadio[vehicleid] == 4)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://live.radiogangsta.ro:8800");
- }
- else if(CarRadio[vehicleid] == 5)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://www.radiotequila.ro/hiphop.m3u");
- }
- else if(CarRadio[vehicleid] == 6)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://live.radioclubmix.ro:9999");
- }
- else if(CarRadio[vehicleid] == 7)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://livemp3.radiopopular.ro:7777");
- }
- else if(CarRadio[vehicleid] == 8)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiofunky.ro/live.pls");
- }
- else if(CarRadio[vehicleid] == 9)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://dance.radiogangsta.ro:8800");
- }
- else if(CarRadio[vehicleid] == 0)
- {
- StopAudioStreamForPlayer(playerid);
- }
- }
- if(newstate == PLAYER_STATE_PASSENGER)
- {
- if(CarRadio[vehicleid] == 1)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
- }
- else if(CarRadio[vehicleid] == 2)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
- }
- else if(CarRadio[vehicleid] == 3)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.radiozu.ro:8020");
- }
- else if(CarRadio[vehicleid] == 4)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://live.radiogangsta.ro:8800");
- }
- else if(CarRadio[vehicleid] == 5)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://www.radiotequila.ro/hiphop.m3u");
- }
- else if(CarRadio[vehicleid] == 6)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://live.radioclubmix.ro:9999");
- }
- else if(CarRadio[vehicleid] == 7)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://livemp3.radiopopular.ro:7777");
- }
- else if(CarRadio[vehicleid] == 8)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiofunky.ro/live.pls");
- }
- else if(CarRadio[vehicleid] == 9)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://dance.radiogangsta.ro:8800");
- }
- else if(CarRadio[vehicleid] == 0)
- {
- StopAudioStreamForPlayer(playerid);
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if ((newkeys==KEY_CTRL_BACK )&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
- {
- new string[1000];
- strcat(string, "{FFFFFF}Stop Radio\n");
- strcat(string, "{F2D068}Asculta {FFFFFF}Pro FM\n"); // http://stream.profm.ro:8012/profm.mp3
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Taraf\n"); // http://live.radiotaraf.com:8181
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio ZU\n"); // http://stream.radiozu.ro:8020
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Manele Gangsta\n"); // http://live.radiogangsta.ro:8800
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Tequila\n"); // http://www.radiotequila.ro/hiphop.m3u
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Club Mix\n"); // http://live.radioclubmix.ro:9999
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Popular\n"); // http://livemp3.radiopopular.ro:7777
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Funky\n"); // http://radiofunky.ro/live.pls
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Dance Gangsta\n"); // http://dance.radiogangsta.ro:8800
- ShowPlayerDialog(playerid,DIALOG_RADIO,DIALOG_STYLE_LIST,"Car Radio", string, "Play", "Cancel");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(dialogid == DIALOG_RADIO)
- {
- if(response)
- {
- if(listitem == 0)
- {
- StopAudioStreamForPlayer(playerid);
- CarRadio[vehicleid] = 0;
- return 1;
- }
- if(listitem == 1)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
- CarRadio[vehicleid] = 1;
- return 1;
- }
- if(listitem == 2)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
- CarRadio[vehicleid] = 2;
- return 1;
- }
- if(listitem == 3)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.radiozu.ro:8020");
- CarRadio[vehicleid] = 3;
- return 1;
- }
- if(listitem == 4)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://live.radiogangsta.ro:8800");
- CarRadio[vehicleid] = 4;
- return 1;
- }
- if(listitem == 5)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://www.radiotequila.ro/hiphop.m3u");
- CarRadio[vehicleid] = 5;
- return 1;
- }
- if(listitem == 6)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://live.radioclubmix.ro:9999");
- CarRadio[vehicleid] = 6;
- return 1;
- }
- if(listitem == 7)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://livemp3.radiopopular.ro:7777");
- CarRadio[vehicleid] = 7;
- return 1;
- }
- if(listitem == 8)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiofunky.ro/live.pls");
- CarRadio[vehicleid] = 8;
- return 1;
- }
- if(listitem == 9)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://dance.radiogangsta.ro:8800");
- CarRadio[vehicleid] = 9;
- return 1;
- }
- }
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement