Quote:
|
Case 1: You want to emit it on all players. Just client_cmd(0,"spk sound.wav")
|
Normally just set attenuation to 0.0 (ATTN_NONE)
Quote:
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
|
No: 3) use ambient_generic by other entity
Emit[Ambient]Sound flags
Code:
#define SND_SPAWNING (1<<8) // duplicated in protocol.h we're spawing, used in some cases for ambients
#define SND_STOP (1<<5) // duplicated in protocol.h stop sound
#define SND_CHANGE_VOL (1<<6) // duplicated in protocol.h change sound vol
#define SND_CHANGE_PITCH (1<<7) // duplicated in protocol.h change sound pitch
ambient_generic spawnlags
Code:
#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
#define AMBIENT_SOUND_EVERYWHERE 1
#define AMBIENT_SOUND_SMALLRADIUS 2
#define AMBIENT_SOUND_MEDIUMRADIUS 4
#define AMBIENT_SOUND_LARGERADIUS 8
#define AMBIENT_SOUND_START_SILENT 16
#define AMBIENT_SOUND_NOT_LOOPING 32
Normally ambient_generic is looping.
Also if you have an issues with ambient_generic look into Fall Scream plugin.