hiroshima, właśnie mam 2 Foldery CT i TT w nich są roundsoundy wszytko dobrze a mi sie wydaje, że coś z pluginem jest.
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <colorchat> #define PLUGIN "Easy End Round Sounds" #define VERSION "0.1" #define AUTHOR "DarkGL" enum (+=200){ TASK_SHOW=200, TASK_INFORMATION, TASK_TUT } #define INFORMATION_CENTER 1 #define INFORMATION_HUD 2 #define INFORMATION_STATUSTEXT 4 new Array:ct_sounds; new Array:tt_sounds; new bool:all_ok = true; new TAG[64]; new pinf; new menuplaylist; new playlist new roundsound; new bool:play[33]; new g_max_players; new plosowo; new tt_ktora; new ct_ktora; new menuroundsound; new gmsgStatusText; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) if(!all_ok){ return PLUGIN_CONTINUE; } register_event( "SendAudio", "T_win", "a", "2&%!MRAD_terwin"); register_event( "SendAudio", "CT_win", "a", "2&%!MRAD_ctwin"); plosowo = register_cvar("roundsound_mode","0") new sinf = register_cvar("roundsound_information_show","300"); if(get_pcvar_num(sinf)){ set_task(float(get_pcvar_num(sinf)),"information_show",TASK_INFORMATION,_,_,"b") } gmsgStatusText = get_user_msgid("StatusText") g_max_players = get_maxplayers(); return PLUGIN_CONTINUE; } public client_connect(id) { play[id] = true; } public roundsound_on(id){ menu_display(id,menuroundsound) return PLUGIN_HANDLED; } public roundsound_handle(id,menu,item){ if(item == MENU_EXIT){ return PLUGIN_CONTINUE; } switch(item){ case 0: { ColorChat(id,GREEN,"[%s] Wlaczyles roundsounda",TAG) play[id] = true; } case 1: { play[id] = false; ColorChat(id,GREEN,"[%s] Wylaczyles roundsounda",TAG) } } return PLUGIN_CONTINUE; } public playlist_show(id){ menu_display(id,menuplaylist); return PLUGIN_HANDLED; } public information_show(id){ static send=0; switch(send){ case 0: { if(!get_pcvar_num(playlist)){ if(get_pcvar_num(roundsound)){ ColorChat(0,TEAM_COLOR,"[%s] W celu wlaczenia /wylaczenie roundsounda napisz na czacie /roundsound",TAG) } } else { ColorChat(0,TEAM_COLOR,"[%s] Jesli chcesz przejrzec playliste napisz na czacie /playlista",TAG) send++; } } case 1: { send--; if(!get_pcvar_num(roundsound)){ if(get_pcvar_num(playlist)){ ColorChat(0,TEAM_COLOR,"[%s] Jesli chcesz przejrzec playliste napisz na czacie /playlista",TAG) } } else { ColorChat(0,TEAM_COLOR,"[%s] W celu wlaczenia/wylaczenie roundsounda napisz na czacie /roundsound",TAG) } } } } public playlist_show_handle(id,menu,item){ if(item == MENU_EXIT){ return PLUGIN_CONTINUE; } new szConfDir[128]; get_configsdir(szConfDir,charsmax(szConfDir)); switch(item){ case 0: { format(szConfDir,charsmax(szConfDir),"%s/ctplaylist.txt",szConfDir); show_motd(id,szConfDir,"PlayLista CT") } case 1: { format(szConfDir,charsmax(szConfDir),"%s/ttplaylist.txt",szConfDir); show_motd(id,szConfDir,"PlayLista TT") } } playlist_show(id) return PLUGIN_CONTINUE; } public T_win(){ if(ArraySize(tt_sounds)-1 >= 0){ new szPath[256]; if(get_pcvar_num(plosowo)){ ArrayGetString(tt_sounds,random_num(0,ArraySize(tt_sounds)-1),szPath,sizeof szPath) } else { if(tt_ktora>=ArraySize(tt_sounds)-1){ tt_ktora = 0; } ArrayGetString(tt_sounds,tt_ktora++,szPath,charsmax(szPath)) } play_sound(szPath) } } public CT_win(){ if(ArraySize(ct_sounds)-1 >= 0){ new szPath[256]; if(get_pcvar_num(plosowo)){ ArrayGetString(ct_sounds,random_num(0,ArraySize(ct_sounds)-1),szPath,sizeof szPath) } else { if(ct_ktora>=ArraySize(tt_sounds)-1){ ct_ktora = 0; } ArrayGetString(ct_sounds,ct_ktora++,szPath,charsmax(szPath)) } play_sound(szPath) } } public plugin_precache(){ ct_sounds = ArrayCreate(256,1) tt_sounds = ArrayCreate(256,1) new ptag = register_cvar("roundsound_tag","AMXX.PL"); pinf = register_cvar("roundsound_information_play","abc"); // a - center b - hud c - statustext new ct = register_cvar("roundsound_ct_path","makow/ct") new tt = register_cvar("roundsound_tt_path","makow/tt") playlist = register_cvar("roundsound_playlist_on","1"); roundsound = register_cvar("roundsound_roundsound_on","1"); get_pcvar_string(ptag,TAG,charsmax(TAG)) if(get_pcvar_num(playlist)){ register_clcmd("say /playlist","playlist_show") register_clcmd("say playlist","playlist_show") register_clcmd("say_team /playlist","playlist_show") register_clcmd("say_team playlist","playlist_show") register_clcmd("say /playlista","playlist_show") register_clcmd("say playlista","playlist_show") register_clcmd("say_team /playlista","playlist_show") register_clcmd("say_team playlista","playlist_show") menuplaylist = menu_create("Playlista","playlist_show_handle") menu_additem(menuplaylist,"PlayLista CT") menu_additem(menuplaylist,"PlayLista TT") menu_setprop(menuplaylist,MPROP_EXITNAME,"Wyjscie") menu_setprop(menuplaylist,MPROP_NUMBER_COLOR,"\r") } if(get_pcvar_num(roundsound)){ register_clcmd("say /roundsound","roundsound_on") register_clcmd("say roundsound","roundsound_on") register_clcmd("say_team /roundsound","roundsound_on") register_clcmd("say_team roundsound","roundsound_on") new formats[256]; formatex(formats,charsmax(formats),"[%s] Easy End Round Sound",TAG); menuroundsound = menu_create(formats,"roundsound_handle"); menu_additem(menuroundsound,"Wlacz roundsound") menu_additem(menuroundsound,"wyłącz roundsound") menu_setprop(menuroundsound,MPROP_EXITNAME,"Wyjscie") menu_setprop(menuroundsound,MPROP_NUMBER_COLOR,"\r") } new bool:track = false new szPath[128],szFullPath[256],szFullDir[256],szConfDir[128] new szFile[64]; if(get_pcvar_num(playlist) == 1){ get_configsdir(szConfDir,charsmax(szConfDir)); format(szConfDir,charsmax(szConfDir),"%s/ctplaylist.txt",szConfDir); if(file_exists(szConfDir)){ delete_file(szConfDir); } } get_pcvar_string(ct,szPath,charsmax(szPath)) formatex(szFullDir,charsmax(szFullDir),"sound/%s",szPath) new dp = open_dir(szFullDir, szFile, charsmax(szFile)); if(dp){ if(get_pcvar_num(playlist) == 1){ write_file(szConfDir,"<html><head><title>PlayLista CT</title></head><body bgcolor='black'><font color='white'>",-1) } while(next_file(dp, szFile, charsmax(szFile))){ if(strlen(szFile) < 5){ continue; } if(is_valid(szFile) ){ track = true; formatex(szFullPath,charsmax(szFullPath),"%s/%s",szFullDir,szFile) is_wav(szFile) ? precache_sound(szFullPath[6]) : precache_generic(szFullPath); ArrayPushString(ct_sounds,szFullPath) log_amx("Zaladowano : %s",szFullPath); if(get_pcvar_num(playlist) == 1){ clean_path(szFile) write_file(szConfDir,szFile) write_file(szConfDir,"<br />") } } } write_file(szConfDir,"</font></body></html>",-1) } else { all_ok = false; log_amx("Brak folderu z muzyka dla ct") log_amx("%s",szPath) } close_dir(dp); if(!track){ all_ok = false; return PLUGIN_CONTINUE; } track = false; get_pcvar_string(tt,szPath,charsmax(szPath)) formatex(szFullDir,charsmax(szFullDir),"sound/%s",szPath) if(get_pcvar_num(playlist) == 1){ get_configsdir(szConfDir,charsmax(szConfDir)); format(szConfDir,charsmax(szConfDir),"%s/ttplaylist.txt",szConfDir); if(file_exists(szConfDir)){ delete_file(szConfDir); } } dp = open_dir(szFullDir, szFile, charsmax(szFile)); if(dp){ if(get_pcvar_num(playlist) == 1){ write_file(szConfDir,"<html><head><title>PlayLista TT</title></head><body bgcolor='black'><font color='white'>",-1) } while(next_file(dp, szFile, charsmax(szFile))){ if(strlen(szFile) < 5){ continue; } if(is_valid(szFile) ){ track = true; formatex(szFullPath,charsmax(szFullPath),"%s/%s",szFullDir,szFile) is_wav(szFile) ? precache_sound(szFullPath[6]) : precache_generic(szFullPath); ArrayPushString(tt_sounds,szFullPath) log_amx("Zaladowano : %s",szFullPath); if(get_pcvar_num(playlist) == 1){ clean_path(szFile) write_file(szConfDir,szFile) write_file(szConfDir,"<br />") } } } write_file(szConfDir,"</font></body></html>",-1) } else { all_ok = false; log_amx("Brak folderu z muzyka dla tt") } close_dir(dp); if(!track){ all_ok = false; return PLUGIN_CONTINUE; } return PLUGIN_CONTINUE; } play_sound(file[]){ for(new i = 1;i<=g_max_players;i++){ if(!is_user_connected(i) || !play[i]){ continue; } client_cmd(i,"%s%s^"",is_wav(file) ? "spk ^"":"mp3 play ^"sound/",file[6]) } new szFile[256] remove_filepath(file,szFile,charsmax(szFile)) clean_path(szFile) new formats[256]; formatex(formats,charsmax(formats),"[%s] Obecnie Gramy %s",TAG,szFile) if(getFlags()&INFORMATION_CENTER){ set_task(1.0,"show_center",TASK_SHOW,formats,sizeof(formats)) } if(getFlags()&INFORMATION_HUD){ show_hud(formats); } if(getFlags()&INFORMATION_STATUSTEXT){ show_statustext(formats); } } public show_center(szFile[]){ for(new i = 1;i<=g_max_players;i++){ if(!is_user_connected(i) || !play[i]){ continue; } client_print(i,print_center,szFile) } } public show_hud(szFile[]){ for(new i = 1;i<=g_max_players;i++){ if(!is_user_connected(i) || !play[i]){ continue; } set_hudmessage(0, 255, 42, -1.0, 0.2, 0, 6.0, 12.0) show_hudmessage(i, szFile) } } public show_statustext(szFile[]){ for(new i = 1;i<=g_max_players;i++){ if(!is_user_connected(i) || !play[i]){ continue; } message_begin(MSG_ONE_UNRELIABLE, gmsgStatusText, {0,0,0}, i) write_byte(0) write_string(szFile) message_end() } } bool:is_wav(file[]){ new iSize = strlen(file) - 4; if(iSize > 0 ){ if(equali(file[iSize], ".wav")){ return true; } } return false; } getFlags() { static flags[27] get_pcvar_string(pinf, flags, 26) return read_flags(flags) } bool:is_valid(szFilename[]){ new iSize = strlen(szFilename) - 4; if(iSize > 0){ if(equali(szFilename[iSize], ".mp3") || equali(szFilename[iSize], ".wav")){ return true; } } return false } clean_path(szFileName[]){ for(new iPos = strlen(szFileName)-4;iPos < strlen(szFileName);iPos++){ szFileName[iPos] = ' '; } }