Jump to content
Sign in to follow this  
Maguila.gm

Make radio play a song

Recommended Posts

I am trying to place a radio and make it to play a 3D music, however i was unsuccessfull. Can someone correct my code pls.

My attempt:

Create a description.ext file and write this:

class CfgMusic {
    tracks[] = {};
    class track1 {
        name = "song1";
        sound[] = {"\music\song1.ogg", db+0, 1.0};
    };

Then create a playMusic.sqf file and do this:

// Get the radio object
_radio = _this select 0;

// Parameters for the sound
_params = ["track1", 100, 1];

// Call the function to play the sound globally in 3D
[_radio, _params] call CBA_fnc_globalSay3d;

then in the radio initialization i wrote the following:

this execVM "playMusic.sqf";

 

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
Sign in to follow this  

×