/* Plugin generated by AMXX-Studio */ #include #include #define PLUGIN "MiniRadio by Egor" #define VERSION "1.0" #define AUTHOR "Egor" new s_Item[256], g_MusicStatus[32], name[32], itemol[256], i new fmst[128], txt[128], station[128] new i_Menu, cvar new const status[][] = { "http://cluster.quantumart.ru/broadcast/default.aspx?media=hitfm", // 0 "http://cluster.quantumart.ru/broadcast/default.aspx?media=maximum", // 1 "http://217.199.213.168:8000/v1_1", // 2 "http://cluster.quantumart.ru/broadcast/default.aspx?media=rusradio", //3 "http://cluster.quantumart.ru/broadcast/default.aspx?media=station04", // 4 "http://cluster.quantumart.ru/broadcast/default.aspx?media=station01", // 5 "http://cluster.quantumart.ru/broadcast/default.aspx?media=station02", //6 "http://cluster.quantumart.ru/broadcast/default.aspx?media=station03",//7 "http://cluster.quantumart.ru/broadcast/default.aspx?media=station10",//8 "http://cluster.quantumart.ru/broadcast/default.aspx?media=montecarlo",//9 "mms://live.rfn.ru/unost/stream.asf",//10 "http://cluster.quantumart.ru/broadcast/default.aspx?media=07"//11 } new const status2[][] = { "HIT FM", // 0 "Maximum", // 1 "ENERGY", // 2 "RUS RADIO", //3 "DFM Urban", // 4 "DFM Club", // 5 "DFM Fresh", //6 "DFM Dance",//7 "DFM Love",//8 "Montecarlo",//9 "UFM",//10 "Disco 90th"//11 } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /fm", "fmd") cvar = register_cvar("amx_miniradio_showtime", "60.0") radhud() } public fm(id) { new i_Menu = menu_create("\yMiniRadio \wBy \rSLIMSHADY:", "radio") menu_additem(i_Menu, status2[0], "1",0) menu_additem(i_Menu, status2[1], "2", 0) menu_additem(i_Menu, status2[2], "3", 0) menu_additem(i_Menu, status2[3], "4", 0) menu_additem(i_Menu, status2[4], "5", 0) menu_additem(i_Menu, status2[5], "6", 0) menu_additem(i_Menu, status2[6], "7", 0) menu_additem(i_Menu, status2[7], "8", 0) menu_additem(i_Menu, status2[8], "9", 0) menu_additem(i_Menu, status2[9], "10", 0) menu_additem(i_Menu, status2[10], "11", 0) menu_additem(i_Menu, status2[11], "12", 0) menu_setprop(i_Menu, MPROP_NEXTNAME, "далее") menu_setprop(i_Menu, MPROP_BACKNAME, "назад") menu_setprop(i_Menu, MPROP_EXITNAME, "Выйти") menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) return PLUGIN_HANDLED } public client_disconnect(id) g_MusicStatus[id] = 0 public hudradio(i) { name[i] = 0 itemol[0] = 0 for(i = 1; i <= get_maxplayers(); i++) { if(!is_user_connected(i) || !g_MusicStatus[i]) continue get_user_name(i, name, 31) formatex(itemol, 255, "%s %s^n", itemol, name) } } public radhud() { if(name[i] == 0) { set_hudmessage(127, 0, 255, 0.85, 0.31, 2, 6.0, 12.0, 0.0, 0.0, 1) show_hudmessage(0, "Слушай FM радио!^nНапиши /fm в чат =)") } else { set_hudmessage(127, 0, 255, 0.85, 0.31, 2, 6.0, 12.0, 0.0, 0.0, 1) show_hudmessage(0, "Слушай FM радио!^nНапиши /fm в чат =)^nРадио слушают:^n%s", itemol) } set_task(get_pcvar_float(cvar), "radhud") } public fmd(id) { formatex(s_Item, charsmax(s_Item), "%s", g_MusicStatus[id] ? "\yОтключить" : "\yВключить случайное") if(g_MusicStatus[id] == 1) { formatex(txt, charsmax(txt), "\yMiniRadio \wBy \rSLIMSHADY^n\wВы слушаете: \y%s", station[id]) i_Menu = menu_create(txt, "radiod") menu_additem(i_Menu, s_Item, "1", 0) menu_additem(i_Menu, "Случайная станция", "3", 0) menu_additem(i_Menu, "\wСписок станций", "2", 0) } else { i_Menu = menu_create("\yMiniRadio \wBy \rSLIMSHADY", "radiod") menu_additem(i_Menu, s_Item, "1", 0) menu_additem(i_Menu, "\wСписок станций", "2", 0) } menu_setprop(i_Menu, MPROP_NEXTNAME, "далее") menu_setprop(i_Menu, MPROP_BACKNAME, "назад") menu_setprop(i_Menu, MPROP_EXITNAME, "Выйти") menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) return PLUGIN_HANDLED } public radiod(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data) switch(i_Key) { case 1: { if(g_MusicStatus[id] > 0) { g_MusicStatus[id] = 0 hudradio(i) ShowInfMotd(id) } else { randomize(id) } } case 2: { fm(id) } case 3: { randomize(id) } } menu_destroy(menu) return PLUGIN_HANDLED } public ShowInfMotd(id) { static buffer[4096], len; if(g_MusicStatus[id] == 0) { len = format(buffer, charsmax(buffer), "") len += format(buffer[len], charsmax(buffer) - len, "play") len += format(buffer[len], charsmax(buffer) - len, "

") len += format(buffer[len], charsmax(buffer) - len, "Radio by SLIMSHADY is DISABLED
") len += format(buffer[len], charsmax(buffer) - len, "

") } else { len = format(buffer, charsmax(buffer), "") len += format(buffer[len], charsmax(buffer) - len, "play") len += format(buffer[len], charsmax(buffer) - len, "

") len += format(buffer[len], charsmax(buffer) - len, "Playing: %s
", station[id]) len += format(buffer[len], charsmax(buffer) - len, "

") len += format(buffer[len], charsmax(buffer) - len, "Идет буферизация... Вы можете закрыть окно.
") len += format(buffer[len], charsmax(buffer) - len, "(Если не включится в течении 30-ти секунд, нужно перезагрузить - отключить и заново включить.)
") len += format(buffer[len], charsmax(buffer) - len, "

") len += format(buffer[len], charsmax(buffer) - len, "

") } show_motd(id, buffer, "RADIO BY SLIMSHADY") } public radio(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data) formatex(fmst[id], charsmax(fmst), "%s", status[i_Key-1]) formatex(station[id], charsmax(fmst), "%s", status2[i_Key-1]) g_MusicStatus[id] = 1 ShowInfMotd(id) hudradio(i) menu_destroy(menu) return PLUGIN_HANDLED } public randomize(id) { new rrand = random_num(0, 11) formatex(fmst[id], charsmax(fmst), status[rrand]) formatex(station[id], charsmax(fmst), status2[rrand]) g_MusicStatus[id] = 1 ShowInfMotd(id) hudradio(i) return PLUGIN_HANDLED }