Problem
Dmk880
29.10.2010
Witam otóż mam mały problem
Mianowicie chciałem zrobić plugin który odtwarza muzykę na starcie oraz wyświetla nazwę mp3 i długość
I mam mały problem bo wyskakuje mi takie coś
i nie odtwarza dźwięku
Do kompilacji potrzeba pliku .inc z http://amxx.pl/soundinfo-t29921.html
Proszę o pomoc
Mianowicie chciałem zrobić plugin który odtwarza muzykę na starcie oraz wyświetla nazwę mp3 i długość
I mam mały problem bo wyskakuje mi takie coś
i nie odtwarza dźwięku
Do kompilacji potrzeba pliku .inc z http://amxx.pl/soundinfo-t29921.html
Proszę o pomoc
#include <amxmodx> #include <amxmisc> #include <soundinfo> #define AUTHOR "Dmk880" new gFiles[300][128] new gCount=0 new cSoundsDir[] = "sound/soundstart/" public plugin_init() { register_logevent("func_round",2,"1=Round_Start") } public func_round() { if(gCount>0) { client_cmd(0,"stopsound") new cleanFile[128] format(cleanFile, 128, "%s", szFilename[]) replace_all(cleanFile, 128, "_", " ") replace_all(cleanFile, 128, ".mp3", "") set_hudmessage(255, 0, 0, 0.11, 0.11, 0, 6.0, 12.0) show_hudmessage(0, "%s",cleanFile) set_hudmessage(255, 0, 0, 0.11, 0.12, 0, 6.0, 12.0) show_hudmessage(0, "gFiles[rand]") set_hudmessage(255, 0, 0, 0.11, 0.13, 0, 6.0, 12.0) show_hudmessage(0, "gFiles[rand]") play_any_sound(gFiles[rand]) } return PLUGIN_HANDLED } public plugin_precache() { new rsFile[128],s[128],i get_configsdir(rsFile, 128) format(rsFile, 128 ,"%s/soundstart.ini", rsFile) //addons/amxmodx/configs/ i=fopen(rsFile,"rt") gCount=0 if(i==0){ log_amx("Blad konfiguracji [%s]", rsFile) } else { while (!feof(i)) // Czyta config z soundstart.ini { fgets(i,s,128) trim(s) if(s[0]!=0) { log_amx("Loaded [%s]", s); copy(gFiles[gCount], 128, s) gCount++ } } fclose(i) } for(i=0;i<gCount;i++) { format(s, 200, "%s%s", cSoundsDir, gFiles[i]) precache_generic(s) } log_amx("Loaded music files: %d", gCount) return PLUGIN_CONTINUE } public play_any_sound(sound[]) { new is_mpeg = ( containi(sound, ".mp3") != -1 ) if ( is_mpeg ) client_cmd(0, "mp3 play ^"%s%s^"", cSoundsDir, sound) else client_cmd(0, "spk ^"%s%s^"", cSoundsDir, sound) }