climber_finish(id)
a chciałbym aby było losowane właśnie przy uzyciu funkcji climber_finish(id)
Fragmenty kodu związany z muzyka mp3:
new soundfile[128] new cached
public plugin_precache() { new txtlen new loop new line new config[64] get_configsdir(config, 63) format(config, 63, "%s/kzpl_mp3.cfg", config) new lines = file_size(config, 1) if (file_exists(config)) { while(cached != 1 && loop < 100) { line = random_num(0,lines) read_file(config,line,soundfile,128,txtlen) if(containi(soundfile,".mp3") != -1) { if((file_exists(soundfile) == 1) && (equal(soundfile[0],";",1) != 1)) { precache_generic(soundfile) server_print("[%s] Muzyka MP3: Caching ^"%s^".", PLUGIN_NAME, soundfile) cached = 1 } else { server_print("[%s] Muzyka MP3: Skipping ^"%s^".", PLUGIN_NAME, soundfile) } } loop += 1 } } else { write_file(config,"",-1) } return PLUGIN_CONTINUE }
climber_finish(id) { if(cached == 1) { client_cmd(0, "mp3 play %s", soundfile) server_print("[%s] Muzyka: Playing ^"%s^".", PLUGIN_NAME, soundfile) if(get_cvar_num("kz_muzyka") == 1) { } } else { server_print("[%s] Muzyka: No Soundfile!!!", PLUGIN_NAME) } }