Ambient
Could someone explain how I would use this?
Quote:
Code:
May I please have an explanatory example? |
Code:
What is this? id - entity to emit from CHAN_AUTO - the channel to emit from. More details here: http://www.amxmodx.org/funcwiki.php?...=1#const_sound g_szSound - any sound file, like "mysound.wav" 1.0 - volume ATTN_NORM - attenuation level 0 - flags, not generally needed PITCH_NORM - You can modify the pitch with this sound it sounds more high or low. |
I know how to use emit_sound. I was looking for the thing closest to "ambient_generic" that I could find. I don't want the sound to be emitted on a player. At an origin. Then again, emit sound might work at an origin?
Code:
|
Here's what you can do:
Case 1: You want to emit it on all players. Just client_cmd(0,"spk sound.wav") Case 2: You want to emit it from an ambient generic. Steps: 1) Create an ambient_generic (create_entity) 2) Set its origin and whatever other properties (entity_set_x, DispatchSpawn) 3) emit_sound on it I'm not quite sure how to use EF_EmitAmbientSound, I'm guessing it's very similar if not the same as emit_sound. |
One last thing, how would I "replay" the sound after the file was finished playing. Other than an infinite set_task loop until it ends to execute it again.
|
Quote:
I think there's a loop thing somewhere but I'm not sure how to do it. |
Quote:
Quote:
Emit[Ambient]Sound flags Code:
ambient_generic spawnlags Code:
Normally ambient_generic is looping. Also if you have an issues with ambient_generic look into Fall Scream plugin. |
I'm probably wrong about this, I don't much about the way HL handles sound, but when you set the channel to CHAN_STATIC, it seems to repeat the sound endlessly.
|
Would I put the ambient_generic code in public client_putinserver?
|
Depends on what did you mean by "ambient_generic code". ;)
|
| All times are GMT -4. The time now is 16:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.