Raised This Month: $12 Target: $400
 3% 

"Speak from Location"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 11-04-2013 , 15:12   "Speak from Location"
Reply With Quote #1

I am trying to simulate the !HEV_DEAD[0|1] from sentences.txt

PHP Code:
// medical
HEV_DEAD0 fvox/beep beepbeep beepbeepbeepflatline
HEV_DEAD1 fvox
/beep beepbeep beepbeepflatline 
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(flatlinecharsmax(flatline), "^"fvox/beep beepbeep beepbeep, %s^""random_num(01) ? "beep, flatline" "flatline");
    
emit_sound(idCHAN_AUTO flatline0.5ATTN_NORM0PITCH_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?)
__________________
+|- KARMA Respectively

HLM is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-05-2013 , 00:33   Re: "Speak from Location"
Reply With Quote #2

You could try to emit each sound one by one.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-05-2013 , 04:50   Re: "Speak from Location"
Reply With Quote #3

You could create a wav file with those sounds to make it a single file.
__________________

Last edited by Blizzard_87; 11-05-2013 at 04:50.
Blizzard_87 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-05-2013 , 12:13   Re: "Speak from Location"
Reply With Quote #4

Also, you can use spk, speak commands, emit_sound, SendAudio message with any sound that exists in %MODDIR/sound/sentences.txt, you just have to put a ! in front of sound key

examples :

PHP Code:
client_cmd(id"spk !HEV_DEAD"); 
PHP Code:
emit_sound(idCHAN_VOICE"!HEV_DEAD"VOL_NORMATTN_NORM0PITCH_NORM); 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-05-2013 at 12:13.
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode