Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Stop Music?
Cetex1337 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jun 2012
Reputation: 0
#1
Stop Music?

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(); ?
06-25-2012, 02:51 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Stop Music?

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)
06-25-2012, 02:58 PM
Find
Cetex1337 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jun 2012
Reputation: 0
#3
RE: Stop Music?

So how should the full script be like?
07-24-2012, 02:16 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: Stop Music?

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.

(This post was last modified: 07-24-2012, 02:24 PM by SilentStriker.)
07-24-2012, 02:24 PM
Find
Cetex1337 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jun 2012
Reputation: 0
#5
RE: Stop Music?

(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
07-24-2012, 02:42 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: Stop Music?

You're welcome Smile

07-24-2012, 02:45 PM
Find




Users browsing this thread: 1 Guest(s)