import es, random, os ######################################################################################### # # # Roundendsounds v1.1 # # # # First Version by Brainsucker, edited by sMo.licious # # # # Plays Random sound every Round_end. Specific to the Winning Team. e.g. CTs or Ts # # # # Usage: # # Edit the Path for both Directorys beyond this box and save to: # # /cstrike/addons/eventscripts/roundendsound/ # # add "es_load roundendsound" to the autoexec.cfg and restart the server # # # # visit: http://www.logimaxx.net # # # ######################################################################################### #Add the Path to your Terrorists Win-Sounds-Directory: #(relative to cstrike/sound/ directory) tOrdner = "winsounds/terwin/" #Add the Path to your Counter-Terrorists Win-Sounds-Directory: #(relative to cstrike/sound/ directory) ctOrdner = "winsounds/ctwin/" # #No Edits need to be done beyond this line!!! # info = es.AddonInfo() info.name = "Roundendsounds" info.version = "1.0" info.url = "http://addons.eventscripts.com/addons/view/roundendsound" info.basename = "roundendsounds" info.author = "sMo.licious" es.ServerVar('roundendsound_ver', info.version, 'Roundendsounds Version').makepublic() t_sounds = os.listdir(es.getString("eventscripts_gamedir") + "/sound/" + tOrdner) ct_sounds = os.listdir(es.getString("eventscripts_gamedir") + "/sound/" + ctOrdner) def es_map_start(ev): download() def round_end(event_var): tSound = tOrdner + random.choice(t_sounds) ctSound = ctOrdner + random.choice(ct_sounds) for x in es.getUseridList(): if es.getplayersteamid(x) != "BOT": if int(event_var['winner']) == 2: es.cexec(x, "play %s" % tSound) if int(event_var['winner']) == 3: es.cexec(x, "play %s" % ctSound) def download(): for x in t_sounds: es.stringtable("downloadables", "sound/" + tOrdner + "%s" % x) for x in ct_sounds: es.stringtable("downloadables", "sound/" + ctOrdner + "%s" % x)