Hello,
I'm new in plugin scripting and I want to create plugin similiar to ultimate sounds but with custom sounds, messages and streaks, it works good but it won't play sound (it will download it AND it does show message)
Code:
#include <amxmodx>
#include <amxmisc>
#define AUTHOR "SEnergy!"
#define VERSION "1.00"
#define PLUGIN "Sounds"
new first_blood
//new kills[9]
//new streak
new sounds[3][] =
{
"announce/first_blood"
}
new messages[3][] =
{
"%s has First Blood!"
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("DeathMsg", "event_death", "a");
register_event("ResetHUD", "reset_hud", "b");
return PLUGIN_CONTINUE
}
public event_death(id)
{
new killer = read_data(1)
new victim = read_data(2)
new vicname[32], killname[32]
get_user_name(victim, vicname, 31)
get_user_name(killer, killname, 31)
if(first_blood)
{
set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, messages[0], killname)
client_cmd(0, "spk %s", sounds[0]);
first_blood = 0
}
return PLUGIN_CONTINUE
}
public reset_hud(id)
{
first_blood = 1
}
public plugin_precache()
{
precache_sound("announce/first_blood.wav")
return PLUGIN_CONTINUE
}