Jump to content
stu81

Ingame music trigger

Recommended Posts

I'm trying to get a song to play in game from a radio trigger. I can get it to play but only I can hear it. Other players can't even with music turned up.

Setup as follows....

Description.ext is .....

class cfgMusic

{

tracks[]={song1};

class track1

{

name="song1";

sound[] = {\music\songname1.ogg, db+5, 1.0};

};

class track2

{

name="song2";

sound[] = {\music\songname2.ogg, db+5, 1.0};

};

};

Called by a triggers radio alpha.....

nul=execVM "scripts\songname1.sqf";

nul=execVM "scripts\songname2.sqf";

Songname1.sqf.........

PlayMusic "track1";

Songname2.sqf.........

PlayMusic "track2";

As I said, plays for just me and not the whole server.

Thanks

Ps I have the real song names in instead of songname1 etc and its a dedicated server if that changes anything.

Share this post


Link to post
Share on other sites

The reason (I think) it is only playing for you on the server is because you are using a script .sqf when you don't need to for playing a music track.

 

Try this instead...

Description.ext:

class CfgSounds {

class track1 {
    name = "track1";
    sound[] = {music\songname1.ogg,5.0,1.0};
    titles[] = {};};

class track2 {
    name = "track2";
    sound[] = {music\songname2.ogg,5.0,1.0};
    titles[] = {};};
};

In Trigger(s) Activation:

PlayMusic "track1";

That should result in the music track playing for all connected clients.

 

Regards Hawk.

Share this post


Link to post
Share on other sites
On 11/5/2015 at 10:29 AM, hawk_silk said:

The reason (I think) it is only playing for you on the server is because you are using a script .sqf when you don't need to for playing a music track.

 

Try this instead...

Description.ext:


class CfgSounds {

class track1 {
    name = "track1";
    sound[] = {music\songname1.ogg,5.0,1.0};
    titles[] = {};};

class track2 {
    name = "track2";
    sound[] = {music\songname2.ogg,5.0,1.0};
    titles[] = {};};
};

In Trigger(s) Activation:


PlayMusic "track1";

That should result in the music track playing for all connected clients.

 

Regards Hawk.



Hi there, I know I'm responding to a post that's nearly a decade old but I'm kind of desperate. I tried using this method and activating the playMusic function with a blufor detection trigger and had no luck. Any clue what I might be doing wrong?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×