EmitGameSound

Last Updated2021-06-24
Created At2014-07-04

Emits a game sound to a list of clients. Game sounds are found in a game's scripts/game_sound.txt or other files referenced from it Note that if a game sound has a rndwave section, one of them will be returned at random.

stock bool EmitGameSound(const int[] clients, int numClients, const char[] gameSound, int entity = -2, int flags = SND_NOFLAGS, int speakerentity = -1, const float origin[3] = NULL_VECTOR, const float dir[3] = NULL_VECTOR, bool updatePos = true, float soundtime = 0.000000)

Parameters

const int[] clients
Array of client indexes.
int numClients
Number of clients in the array.
const char[] gameSound
Name of game sound.
int entity
Entity to emit from.
int flags
Sound flags.
int speakerentity
Unknown.
const float[3] origin
Sound origin.
const float[3] dir
Sound direction.
bool updatePos
Unknown (updates positions?)
float soundtime
Alternate time to play sound for.

Return Value

bool True if the sound was played successfully, false if it failed

Error

Invalid client index or client not in game.