PrecacheScriptSound Function

Precache a game sound.

Most games will precache all game sounds on map start, but this is not guaranteed... Team Fortress 2 is known to not pre-cache MvM game mode sounds on non-MvM maps.

Due to the above, this native should be called before any calls to GetGameSoundParams, EmitGameSound*, or EmitAmbientGameSound.

It should be safe to pass already precached game sounds to this function.

Note: It precaches all files for a game sound.

bool PrecacheScriptSound(const char[] soundname)

Parameters

const char[] soundname

Game sound to precache

Return Value

True if the game sound was found, false if sound did not exist or had no files