Hello, i think im wrong in this source code, the sound isnt being played, but the sound files precaches.
any help?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Warning Sound"
#define VERSION "1.0"
#define AUTHOR "LVNDR"
const MAX_SOUNDS = 2;
new g_Sounds[MAX_SOUNDS][32] = {
{"revenge/warning1.wav"},
{"revenge/warning2.wav"}
};
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public plugin_precache()
{
for (new i = 0; i < MAX_SOUNDS; i++)
{
precache_sound(g_Sounds[i]);
}
}
public event_round_start()
{
set_task(2.0, "countdown")
}
public countdown()
{
set_task(5.0, "biohazard_detected")
}
public biohazard_detected()
{
new randSound = random_num(0, MAX_SOUNDS - 1);
emit_sound(0, CHAN_AUTO, g_Sounds[randSound], VOL_NORM, ATTN_NONE, 0, PITCH_NORM);
}