05.12.2013, 18:26
Simples mais util irei adiciona minha radio e reposta aqui.
Code:
/* Sistema de Radios em Veiculos Versгo do Script: 1.0 Criado por: NurbWill */ #include <a_samp> new RadioVeiculoID[MAX_VEHICLES]; enum RadioDataEnum { ShoutcastRadioID[9], ShoutcastRadioName[71] } new RadioData[][RadioDataEnum] = { {"914897","idobi Radio: New. Music. Unfiltered. idobi.com"}, {"9998","Radio SSGames - A Melhor radio eletronica do brasil!"}, {"175821","COOLfahrenheit 93"}, {"166835","Alex Jones'Infowars.com"}, {"16101","RADIO SOUND POP'BRASIL"}, {"66765","Radio Brasil Hits'BRASILHITS.COM"}, {"149762","www.requestradio.in.th"}, {"7581","BlackBeats.FM'finest in blackbeats'powered by surfmusik.de'"}, {"56491","TamilFlash.Fm |Tamil Radio Powered by: Brapa.Com"}, {"182443","Radio Television Caraibes broadcasting live from Port-au-Prince Haiti"}, {"549041","181.FM'Christmas Mix"}, {"102286","Adom 106.3FM Powered by Mediagh"}, {"9483900","Lankasri FM"}, {"197330","COOLfahrenheit 93"}, {"298757","RAC1. Des de Catalunya per tot el mon"}, {"38486","ANTENA1'94 7 FM"}, {"12380","waizon radio"}, {"675457","181.FM'Christmas Traditional Classics"}, {"19035","AlTools"}, {"22146","Venice Classic Radio Italia"}, {"8318","HOT 108 JAMZ'#1 FOR HIP HOP'www.hot108.com'"}, {"9256827","KissFM Romania'www.kissfm.ro"}, {"223772","MusicRadio.in.th@By Pj NeoOne"}, {"33437","COOLfahrenheit 93"}, {"104559","Radio IKIMfm Malaysia"}, {"49892","100Hitz'Top 40"}, {"1685803","Radio ZU Live"}, {"402","radio city 24 & 5aab radio punjabi radio"}, {"7540","CINEMIX"}, {"1564322","TechnoBase.FM'24h Techno, Dance, HandsUp and More"}, {"194257","AnimeNfo Radio | Serving you the best Anime and Doujin music!"}, {"1685803","Radio ZU Live"}, {"402","radio city 24 & 5aab radio punjabi radio"}, {"7540","CINEMIX"}, {"1564322","TechnoBase.FM'24h Techno, Dance, HandsUp and More"}, {"194257","AnimeNfo Radio | Serving you the best Anime and Doujin music!"}, {"27824","Groove Salad (SomaFM)"}, {"1640384","Live Kirtan'Sri harmandir Sahib'Golden Temple"}, {"80613","KRAL FM"}, {"508962","181.FM'PARTY 181 -=- Your Official Party Station!"}, {"366480","181.fm'True R&B"}, {"651101","CHILLOUT LOUNGE RADIO (1.FM TM)"}, {"42016","RADIO SOUND POP'BRASIL"}, {"196253","181.fm'Awesome 80's"}, {"9479710","Tinimy.de"}, {"221956","181.FM'Kickin' Country'Today's BEST Country!"}, {"19460","181.fm'The Heart (All Love Songs)"}, {"31645","ChartHits.FM'Top 40 Radio'Mega Hot Music!"}, {"1660760","Magic FM Romania www.magicfm.ro Soft Music"}, {"220986","COOLcelsius 91.5"}, {"1697879","iKyzaa DJ"}, {"144896","[WINK.IN.TH]-THAILAND"}, {"1599623","Virginhitz 95.5"}, {"12161","Coles Radio National"}, {"1569211","RadioMv.com | Russian Christian Radio (128 Kbps)"}, {"19972","181.FM'POWER 181 -=[: The Hitz Channel :]=- www.181.fm"}, {"92498","181.fm' The Mix Channel (70s, 80s, 90s and Today's Best Music)"}, {"144936","Alex Jones'Infowars.com"}, {"71946","Nhyira 104.5 FM Powered by Mediagh"}, {"17399","Radioparty.pl'Techno, Dance, Club, Hands Up, House, Trance"}, {"14659","Eazy1055"}, {"37586","181.FM'The Buzz (Your Alternative Station!)"}, {"691274","1.FM'ABSOLUTE TOP 40 RADIO"}, {"633861","181.FM'Christmas Smooth Jazz"}, {"57352","HouseTime.FM24h House, Electro and More"}, {"105867","181.FM'The BEAT * #1 For HipHop and R&B"} }; public OnFilterScriptInit() { print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); print(" SHOUTCAST RADIO SYSTEM"); print(" "); print(" Criado por: NurbWill"); print(" Versгo: 1.0"); print(" "); print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/vradio", cmdtext, true, 10) == 0) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{1B9DFA}[Shoutcast Radio]{8C8C8C} Vocк nгo estб em um veiculo."); new String_Dialog[2100], String_Nome[70]; for(new i = 0; i < 65; ++i) { format(String_Nome, sizeof(String_Nome), "%s", RadioData[i][ShoutcastRadioName]); format(String_Dialog, sizeof(String_Dialog), "%s %s\n", String_Dialog, String_Nome); } ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "{1B9DFA}[Shoutcast Radio]{2A7D52} Uma variedade de radios para vocк ouvir!", String_Dialog, "Tocar", "Fechar"); return 1; } if (strcmp("/pararradio", cmdtext, true, 10) == 0) { new vehicleid = GetPlayerVehicleID(playerid); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{1B9DFA}[Shoutcast Radio]{8C8C8C} Vocк nгo estб em um veiculo."); if(RadioVeiculoID[vehicleid] == 0) return SendClientMessage(playerid, -1, "{1B9DFA}[Shoutcast Radio]{8C8C8C} Este veiculo nгo estб tocando nenhuma radio."); RadioVeiculoID[vehicleid] = 0; StopAudioStreamForPlayer(playerid); SendClientMessage(playerid, -1, "{1B9DFA}[Shoutcast Radio]{8C8C8C} Vocк desligou a radio."); for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == vehicleid && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_PASSENGER && i != playerid) { StopAudioStreamForPlayer(i); } } return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 5000) { if(response) { new rVeiculo = GetPlayerVehicleID(playerid), FaixaID = listitem, Play_String[74]; format(Play_String, sizeof(Play_String), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=%s", RadioData[FaixaID][ShoutcastRadioID]); PlayAudioStreamForPlayer(playerid, Play_String); RadioVeiculoID[rVeiculo] = FaixaID+1; for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerVehicleID(i) == rVeiculo && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_PASSENGER && i != playerid) { PlayAudioStreamForPlayer(i, RadioData[FaixaID][ShoutcastRadioID]); } } } } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { if(RadioVeiculoID[GetPlayerVehicleID(playerid)] != 0) { new PegarRadioID = RadioVeiculoID[GetPlayerVehicleID(playerid)]-1, Play_String[74]; format(Play_String, sizeof(Play_String), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=%s", RadioData[PegarRadioID][ShoutcastRadioID]); PlayAudioStreamForPlayer(playerid, Play_String); } } if(newstate == PLAYER_STATE_PASSENGER) { if(RadioVeiculoID[GetPlayerVehicleID(playerid)] != 0) { new PegarRadioID = RadioVeiculoID[GetPlayerVehicleID(playerid)]-1, Play_String[74]; format(Play_String, sizeof(Play_String), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=%s", RadioData[PegarRadioID][ShoutcastRadioID]); PlayAudioStreamForPlayer(playerid, Play_String); } } if(newstate == PLAYER_STATE_ONFOOT) StopAudioStreamForPlayer(playerid); return 1; } public OnVehicleSpawn(vehicleid) { RadioVeiculoID[vehicleid] = 0; return 1; } public OnVehicleDeath(vehicleid, killerid) { RadioVeiculoID[vehicleid] = 0; return 1; }