public void OnMapStart() { if (!IsSoundPrecached("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3") { PrecacheSound("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3"); } }
And this:
PHP Code:
public void OnMapStart() { if (!IsSoundPrecached("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3") { PrecacheSound("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", true); } }
and this
PHP Code:
public void OnMapStart() { PrecacheScriptSound("sf15.Pumpkin.Bomb"); }
I cannot for the life of me figure this shit out and I need help. Why won't these sounds play outside of a ClientCommand'd playgamesound? I'm using basically the same code I used with kart horns, and I'm having no trouble over there? I've tried searching but I've obviously failed miserably.
public void OnMapStart() { PrecacheScriptSound("sf15.Pumpkin.Bomb"); for (int i = 0; i < sizeof(idleLines); i++) { if (!IsSoundPrecached(idleLines[i])) { PrecacheSound(idleLines[i]); PrecacheSound(idleLines[i], true); } } }
// function that emits the sound EmitAmbientSound(idleLines[GetRandomInt(0, sizeof(idleLines)-1)], pumpkinPos, pumpkin); EmitAmbientSound(idleLines[GetRandomInt(0, sizeof(idleLines)-1)], pumpkinPos, client); EmitAmbientSound("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", pumpkinPos, pumpkin); EmitAmbientSound("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", pumpkinPos, client); EmitAmbientSound(idleLines[GetRandomInt(0, sizeof(idleLines)-1)], playerPos, pumpkin); EmitAmbientSound(idleLines[GetRandomInt(0, sizeof(idleLines)-1)], playerPos, client); EmitAmbientSound("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", playerPos, pumpkin); EmitAmbientSound("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", playerPos, client); EmitAmbientGameSound("sf15.Pumpkin.Bomb.Explode", pumpkinPos, pumpkin); EmitAmbientGameSound("sf15.Pumpkin.Bomb.Explode", playerPos, pumpkin); EmitGameSoundToAll("sf15.Pumpkin.Bomb.Explode", pumpkin); EmitSoundToAll("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", pumpkin); EmitSoundToAll("vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", SOUND_FROM_PLAYER); EmitSoundToClient(client, "vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", SOUND_FROM_PLAYER); EmitSoundToClient(client, "vo/halloween_merasmus/Hall2015_pumpbomb_02.mp3", pumpkin); PrintToChat(client, "THIS PRINTS EVERY GOD DAMN TIME"); //function that emits the sound
AND STILL SILENCE I AM GOING INSANE
EDIT: This thread is now irrelevant, as another person beat me to making the plugin. Presumably the problem was that IsSoundPrecached doesn't function like I thought it does? Removing the IsSoundPrecached check made some of these work.