Frictional Games Forum (read-only)

Full Version: Stop Music?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Guys!

I have used this script, and it is some music starting when the player enters a room. But my issue is that when the player leaves the room / loading a new map, then it keeps going
Quote:void OnEnter()
Quote:{
Quote:PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);
Quote:}
Is there any scripts like StopPlayerMusic(); ?
void StopMusic(float afFadeTime, int alPrio);

Stops music.

afFadeTime - time in seconds until music stops
alPrio -
the priority of the music that should stop (in this case, 10)
So how should the full script be like?
PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);

the 10 is the priority of the music I usually have it on 1 (or more depends if 1 is used by another PlayMusic) but it doesn't really matter but to stop music you must use

StopMusic(1, 10);

first is how long time you want it to fade out and the second needs to have the same priority as the music you want to stop which is in this case 10.
(07-24-2012, 02:24 PM)SilentStriker Wrote: [ -> ]PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);

the 10 is the priority of the music I usually have it on 1 (or more depends if 1 is used by another PlayMusic) but it doesn't really matter but to stop music you must use

StopMusic(1, 10);

first is how long time you want it to fade out and the second needs to have the same priority as the music you want to stop which is in this case 10.
Thanks man +1
You're welcome Smile