here is the code, which is working, except for the fact that no one is able to download the sound file
Code:
public plugin_precache() {
precache_sound("showdown/sd_theme")
}
public plugin_init() {
register_plugin("Showdown","0.1","|Atomik|Fusion|")
register_event("DeathMsg", "Event_DeathMsg", "a")
}
public Event_DeathMsg() {
new cts[32], ts[32], ctsnum, tsnum
get_players(cts, ctsnum, "ae", "CT")
get_players(ts, tsnum, "ae", "TERRORIST")
if(ctsnum == 1 && tsnum == 1)
{
new ctname[32], tname[32]
get_user_name(cts[0], ctname, 31)
get_user_name(ts[0], tname, 31)
set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0, "%s vs. %s", ctname, tname)
play_sound("showdown/sd_theme")
play_sound("showdown/sd_theme")
play_sound("showdown/sd_theme")
}
}
public play_sound(sound[]) {
new players[32], pnum
get_players(players, pnum, "c")
new i
for (i = 0; i < pnum; i++)
{
if (is_user_connecting(players[i]))
continue
client_cmd(players[i], "spk %s", sound)
}
}
^^before anybody asks "Why do u have the same play sound command 3 times in a row?"^^ here is a simple answer, it makes the sound file louder. dont believe me? try the code for urself. the original sound file that im using has a low volume level. and instead of converting, adjusting, and converting the sound file, i figured just play the sound over itself 3 times, thereby increasing the volume level of the file. now, like i said the code is working on my server, the only problem is no one is able to download the sound file. any suggestions would be appreciated. another thing, "why did u make this plugin, miscstats has that option for you" couple of reasons, i didnt like the sound file selection, this only plays when its one t against one ct(thats it) and stats has a way of not registering other game info, i.e shots, etc.