Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********************
- **
- ** m_Radio
- ** v1.0
- **
- **********************/
- #include <a_samp>
- #include <YSI\y_commands>
- #include <foreach>
- #define SCM(%0,%1,%2) SendClientMessage(%0,%1,%2)
- #define SCMTA(%0,%1) SendClientMessageToAll(%0,%1)
- /* dialozi */
- #define RADIO_ON_OFF 4499
- #define MAIN_RADIO 4500
- #define FOR_ME 4501
- #define FOR_EVERYONE 4502
- #define FOR_PLAYER 4503
- #define IN_RADIUS 4504
- #define FOR_PLAYER_LINK 4505
- #define RADIUS_LINK 4506
- #define CUSTOM 4507
- new Text:SongBox;
- new Text:SongInfo;
- new Text:CurrRadioSong;
- public OnFilterScriptInit() {
- CurrRadioSong = TextDrawCreate(38.000000, 140.000000, "RADIO - CURRENT SONG");
- TextDrawBackgroundColor(CurrRadioSong, 255);
- TextDrawFont(CurrRadioSong, 1);
- TextDrawLetterSize(CurrRadioSong, 0.300000, 1.000000);
- TextDrawColor(CurrRadioSong, 65535);
- TextDrawSetOutline(CurrRadioSong, 0);
- TextDrawSetProportional(CurrRadioSong, 1);
- TextDrawSetShadow(CurrRadioSong, 1);
- SongInfo = TextDrawCreate(5.000000, 156.000000, "tuf");
- TextDrawBackgroundColor(SongInfo, 65535);
- TextDrawFont(SongInfo, 3);
- TextDrawLetterSize(SongInfo, 0.200000, 2.000000);
- TextDrawColor(SongInfo, -1);
- TextDrawSetOutline(SongInfo, 1);
- TextDrawSetProportional(SongInfo, 1);
- SongBox = TextDrawCreate(197.000000, 151.000000, "|");
- TextDrawBackgroundColor(SongBox, 255);
- TextDrawFont(SongBox, 1);
- TextDrawLetterSize(SongBox, 0.000000, 3.000000);
- TextDrawColor(SongBox, -1);
- TextDrawSetOutline(SongBox, 0);
- TextDrawSetProportional(SongBox, 0);
- TextDrawSetShadow(SongBox, 1);
- TextDrawUseBox(SongBox, 1);
- TextDrawBoxColor(SongBox, 255);
- TextDrawTextSize(SongBox, 0.000000, 94.000000); }
- public OnPlayerDisconnect(playerid,reason) {
- DeletePVar(playerid,"Radio");
- return true; }
- stock CC(playerid,redova)
- {
- for(new c; c < redova; c++) SendClientMessage(playerid,-1," ");
- }
- stock SetSongInfo(playerid, str[])
- {
- TextDrawHideForPlayer(playerid, SongInfo);
- TextDrawHideForPlayer(playerid, SongBox);
- TextDrawHideForPlayer(playerid, CurrRadioSong);
- new
- strt[256];
- format(strt, sizeof(strt), "%s", str);
- TextDrawSetString(SongInfo, strt);
- TextDrawShowForPlayer(playerid, SongBox);
- TextDrawShowForPlayer(playerid, SongInfo);
- TextDrawShowForPlayer(playerid, CurrRadioSong);
- SetTimerEx("DelSongInfo", 10000, 0, "d", playerid);
- return true;
- }
- stock GetName(playerid)
- {
- new
- ime[MAX_PLAYER_NAME];
- GetPlayerName(playerid,ime,sizeof ime);
- return ime;
- }
- stock PlayAudioStreamForAll(link[])
- {
- foreach(Player,i)
- {
- PlayAudioStreamForPlayer(i,link);
- for(new c; c < 20; c++) SendClientMessage(i,-1," ");
- }
- return true;
- }
- stock StopAudioStreamForAll()
- {
- foreach(Player, i)
- {
- StopAudioStreamForPlayer(i);
- }
- return true;
- }
- YCMD:radio(playerid,params[],help) {
- #pragma unused help
- #pragma unused params
- if(GetPVarInt(playerid,"Radio") == 1) return ShowPlayerDialog(playerid,MAIN_RADIO,DIALOG_STYLE_LIST,"m_Radio","{00FFFF}Pusti pjesmu za sebe\n{FFFFFF}Pusti pjesmu za sve\n{00FFFF}Pusti pjesmu u određenom radijusu\n{FFFFFF}Pusti za nekog igrača\n{00FFFF}Prikazi popis dodanih pjesama","Odaberi","Odustani");
- else
- ShowPlayerDialog(playerid,RADIO_ON_OFF,DIALOG_STYLE_MSGBOX,"{00FFFF}m_Radio","{FFFFFF}Želite li sigurno upaliti server radio?","Da","Ne");
- return true; }
- YCMD:set(playerid,params[],help) {
- #pragma unused help
- #pragma unused params
- SetPVarInt(playerid,"Radio",0);
- return true; }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case RADIO_ON_OFF:
- {
- if(!response) return false;
- SCM(playerid,-1,"Upalili ste radio!");
- SetPVarInt(playerid,"Radio",1);
- ShowPlayerDialog(playerid,MAIN_RADIO,DIALOG_STYLE_LIST,"m_Radio","{00FFFF}Pusti pjesmu za sebe\n{FFFFFF}Pusti pjesmu za sve\n{00FFFF}Pusti pjesmu u određenom radijusu\n{FFFFFF}Pusti za nekog igrača\n{00FFFF}Prikazi popis dodanih pjesama","Odaberi","Odustani");
- }
- case MAIN_RADIO:
- {
- if(!response) return StopAudioStreamForPlayer(playerid),StopAudioStreamForAll();
- if(listitem == 0) {
- ShowPlayerDialog(playerid,FOR_ME,DIALOG_STYLE_INPUT,"m_Radio","Unesite link pjesme koju će te pustiti samo sebi!","Unesi","Odustani"); }
- if(listitem == 1) {
- ShowPlayerDialog(playerid,FOR_EVERYONE,DIALOG_STYLE_INPUT,"m_Radio","Unesite link pjesme koju će te pustiti cijelom serveru!","Unesi","Odustani"); }
- if(listitem == 2) {
- ShowPlayerDialog(playerid,IN_RADIUS,DIALOG_STYLE_INPUT,"m_Radio","Unesite radijus u kojemu će se čuti pjesma!","Unesi","Odustani"); }
- if(listitem == 3) {
- ShowPlayerDialog(playerid,FOR_PLAYER,DIALOG_STYLE_INPUT,"m_Radio","Unesite id igrača kojemu želite pustiti pjesmu!","Unesi","Odustani"); }
- if(listitem == 4) {
- new songstr[600];
- strcat(songstr,"{00FFFF}Patrick Stump ft. Lupe Fiasco - This City\nFall Out Boy - Of All The Gin Joints In All The World\n{00FFFF}Fall Out Boy This Ain't A Scene\nFall Out Boy - Saturday\n{00FFFF}Fall Out Boy - I've Got All This Ringing In My Ears...\nFall Out Boy - You're Crashing , But You're No Wave\n{00FFFF}Fall Out Boy - The Take Over The Breaks Over\nFall Out Boy - Fame < Infamy\n{00FFFF}Fall Out Boy - Don't You Know\nFall Out Boy - Get Busy Living...\n{00FFFF}Green Day - Minority");
- strcat(songstr,"\nGreen Day - Holiday\n{00FFFF}Green Day - American Idiot\nGreen Day - Boulevard of Broken Dreams\nGreen Day - 21 Guns");
- ShowPlayerDialog(playerid,CUSTOM,DIALOG_STYLE_LIST,"m_Radio",songstr,"Odaberi","Odustani"); }
- }
- case FOR_ME:
- {
- if(!response) return false;
- if(strfind(inputtext, "http") != -1)
- {
- PlayAudioStreamForPlayer(playerid,inputtext);
- CC(playerid,15);
- SendClientMessage(playerid,-1,"Pustili ste si pjesmu!"); }
- }
- case FOR_EVERYONE:
- {
- new
- str[128];
- if(!response) return false;
- foreach(Player,i) {
- if(strfind(inputtext, "http") != -1)
- {
- PlayAudioStreamForAll(inputtext);
- CC(i,15);
- format(str,sizeof str,"%s je upalio server radio svima!",GetName(playerid));
- SCMTA(-1,str); } }
- }
- case IN_RADIUS:
- {
- if(!response) return false;
- new
- radius = strval(inputtext);
- SetPVarInt(playerid,"InRadius",radius);
- ShowPlayerDialog(playerid,RADIUS_LINK,DIALOG_STYLE_INPUT,"m_Radio","Odabrali ste radijus\nSada unesite link pjesme koju će se čuti unutar tog radijusa!","Unesi","Odustani");
- }
- case FOR_PLAYER:
- {
- if(!response) return false;
- new
- id = strval(inputtext);
- SetPVarInt(playerid,"StreamingTo",id);
- ShowPlayerDialog(playerid,FOR_PLAYER_LINK,DIALOG_STYLE_INPUT,"m_Radio","Odabrali ste igrača\nSada unesite link pjesme koju će te pustiti tom igraču!","Unesi","Odustani");
- }
- case FOR_PLAYER_LINK:
- {
- if(!response) return false;
- new
- str[128];
- if(strfind(inputtext, "http") != -1) {
- PlayAudioStreamForPlayer(GetPVarInt(playerid,"StreamingTo"),inputtext);
- CC(GetPVarInt(playerid,"StreamingTo"),15);
- format(str,sizeof str,"%s vam je pustio pjesmu preko server radija!",GetName(playerid));
- SCM(GetPVarInt(playerid,"StreamingTo"),-1,str); }
- }
- case RADIUS_LINK:
- {
- if(!response) return false;
- new
- Float:Pos[4];
- if(strfind(inputtext, "http") != -1) {
- foreach(Player,i) {
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
- if(IsPlayerInRangeOfPoint(i,GetPVarInt(playerid,"InRadius"),Pos[0],Pos[1],Pos[2])) {
- PlayAudioStreamForPlayer(i, inputtext, Pos[0], Pos[1], Pos[2], GetPVarInt(playerid,"InRadius"), 1);
- CC(i,15);
- SCM(playerid,-1,"Pustio si pjesmu u određenom radijusu!"); } } }
- }
- case CUSTOM:
- {
- if(listitem == 0) { PlayAudioStreamForPlayer(playerid,"http://www.patrickstump.com/sites/default/files/This City (Feat.LupeFiasco)_0.mp3"),CC(playerid,15),SetSongInfo(playerid,"Patrick Stump ft. Lupe Fiasco - This City"); }
- if(listitem == 1) { PlayAudioStreamForPlayer(playerid,"http://www.ahfunaki.com/mp3s/fall_out_boy-of_all_the_gin_joints_in_all_the_world.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - Of All The Gin Joints In All The World"); }
- if(listitem == 2) { PlayAudioStreamForPlayer(playerid,"http://osfswine.com/stuff/music/mp3/03-fall_out_boy-this_aint_a_scene_its_an_arms_race.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - This Ain't A Scene , It's An Arms Race"); }
- if(listitem == 3) { PlayAudioStreamForPlayer(playerid,"http://0d.media.v4.skyrock.net/music/0dd/021/0dd02111f3f776f97fbc77c920af5b40.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - Saturday"); }
- if(listitem == 4) { PlayAudioStreamForPlayer(playerid,"http://anubis.pendulus.net/mary2/music/Fall_Out_Boy-Infinity_On_High-2007-RNS/14-fall_out_boy-ive_got_all_this_ringing_in_my_ears_and_none_on_my_fingers.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - I've Got All This Ringing In My Ears..."); }
- if(listitem == 5) { PlayAudioStreamForPlayer(playerid,"http://api.ning.com/files/tm860FhQs60k4Ji7K0VDKWpGe4XMf9DRO2b3DldzZv7j6E31*7a5pP-eRr7JRleVVsdOCUY9bSXOJUy4QlP45-T00-Oe2HGn/FallOutBoyYoureCrashingButYoureNoWave.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - You're Crashing , But You're No Wave"); }
- if(listitem == 6) { PlayAudioStreamForPlayer(playerid,"http://anubis.pendulus.net/mary2/music/Fall_Out_Boy-Infinity_On_High-2007-RNS/02-fall_out_boy-the_take_over_the_breaks_over.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - The Take Over , The Breaks Over"); }
- if(listitem == 7) { PlayAudioStreamForPlayer(playerid,"http://anubis.pendulus.net/mary2/music/Fall_Out_Boy-Infinity_On_High-2007-RNS/12-fall_out_boy-fame_infamy.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - Fame < Infamy"); }
- if(listitem == 8) { PlayAudioStreamForPlayer(playerid,"http://anubis.pendulus.net/mary2/music/Fall_Out_Boy-Infinity_On_High-2007-RNS/08-fall_out_boy-dont_you_know_who_i_think_i_am.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - Don't You Know Who I Think I Am?"); }
- if(listitem == 9) { PlayAudioStreamForPlayer(playerid,"http://maxime.sabin.free.fr/perso/musique/12-fall_out_boy-get_busy_living_or_get_busy_dying_(do_your_part_to_save_the_scene_and_stop_going_to_shows)-kzt.mp3"),CC(playerid,15),SetSongInfo(playerid,"Fall Out Boy - Get Busy Living or Get Busy Dying"); }
- if(listitem == 10) { PlayAudioStreamForPlayer(playerid,"http://www.webhostingpal.com/eaoutlaws/mp3/Minority.mp3"),CC(playerid,15),SetSongInfo(playerid,"Green Day - Minority"); }
- if(listitem == 11) { PlayAudioStreamForPlayer(playerid,"http://mcbess.free.fr/mptree/03 - Green Day - Holiday.mp3"),CC(playerid,15),SetSongInfo(playerid,"Green Day - Holiday"); }
- if(listitem == 12) { PlayAudioStreamForPlayer(playerid,"http://suddenlyeverythingsucks.com/jukebox/green_day_american_idiot.mp3"),CC(playerid,15),SetSongInfo(playerid,"Green Day - American Idiot"); }
- if(listitem == 13) { PlayAudioStreamForPlayer(playerid,"http://mhrap.free.fr/mzika/green%20day%20-%20american%20idiot-advance%20-%20boulevard%20of%20broken%20dreams.mp3"),CC(playerid,15),SetSongInfo(playerid,"Green Day - Boulevard of Broken Dreams"); }
- if(listitem == 14) { PlayAudioStreamForPlayer(playerid,"http://www.tellus.cn/xin/21Guns.mp3"),CC(playerid,15),SetSongInfo(playerid,"Green Day - 21 Guns"); }
- }
- }
- return true;
- }
- forward DelSongInfo(playerid);
- public DelSongInfo(playerid)
- {
- TextDrawHideForPlayer(playerid, CurrRadioSong);
- TextDrawHideForPlayer(playerid, SongInfo);
- TextDrawHideForPlayer(playerid, SongBox);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment