I am trying to simulate the !HEV_DEAD[0|1] from sentences.txt
PHP Code:
// medical
HEV_DEAD0 fvox/beep beep, beep beep, beep, beep, flatline
HEV_DEAD1 fvox/beep beep, beep beep, beep, flatline
In HLDM, when a user dies, this sound is emitted at the users location to all users around them, I am trying to simulate this in other games (using Ham_Killed) I have no idea on how to get this to work though, as emit_sound only supports 1 sample, and spk/speak/play only plays for one user.
Here is the code I have tried so far:
PHP Code:
public Hook_Death(id)
{
//
g_longjump[id] = false;
new flatline[64]
format(flatline, charsmax(flatline), "^"fvox/beep beep, beep beep, beep, %s^"", random_num(0, 1) ? "beep, flatline" : "flatline");
emit_sound(id, CHAN_AUTO , flatline, 0.5, ATTN_NORM, 0, PITCH_NORM);
//client_cmd(id, flatline);
//client_print(0, print_chat, flatline);
}
It is very obvious that this wont work as the sample is not a proper wav file and is actually several, my question is, how would I go about achieving this goal?
The closest thing I can think of is using a spk command on any players within X units of the target when they die, however this is not the same as emit_sound, is there any way to do what I am trying to do? (also, spk !HEV_DEAD0 gives an error that it doesnt exist in console, perhaps sentences.txt is not loaded in tfc?)
__________________