Jump to content

Vehicle HiFi for 1.0.6.1


Anhor

Recommended Posts

Did you mean like this juandayz

Spoiler

// Vehicle Sounds
_isbike = typeOf _vehicle in ["MMT_Civ"];
if (_inVehicle && _isbike && (driver _vehicle == player)) then {

    if (s_player_soundbike < 0) then {
        dayz_sounds = _vehicle;
        s_player_soundbike = dayz_sounds addaction[("<t color=""#F7D708"">" + ("Play Song") +"</t>"),"scripts\vehiclesound\soundbike.sqf"];  
        };
    } else {
        dayz_sounds removeAction s_player_soundbike;
        s_player_soundbike = -1;
    };
    
if (_inVehicle && (driver _vehicle == player)) then {

    if (s_player_soundcar < 0) then {
        dayz_sounds = _vehicle;
        s_player_soundcar = dayz_sounds addaction[("<t color=""#F7D708"">" + ("Play Song") +"</t>"),"scripts\vehiclesound\soundvehicle.sqf"];  
        };
    } else {
        dayz_sounds removeAction s_player_soundcar;
        s_player_soundcar = -1;
    }; 
    
if (_inVehicle && {_vehicle isKindOf "Air"} && (driver _vehicle == player)) then {

    if (s_player_soundair < 0) then {
        dayz_sounds = _vehicle;
        s_player_soundair = dayz_sounds addaction[("<t color=""#F7D708"">" + ("Play Song") +"</t>"),"scripts\vehiclesound\soundair.sqf"];  
        };
    } else {
        dayz_sounds removeAction s_player_soundair;
        s_player_soundair = -1;
    };
//Vehicle Sounds End

Spoiler

class CfgSounds
{
    flysound[] =
    {
        soundbike,soundvehicle,soundair
    };
    class soundbike
    {
        name="soundbike";
        sound[]={sounds\BycicleRace.ogg,0.9,1};
        titles[] = {};
    };
    class soundvehicle
    {
        name="soundvehicle";
        sound[]={sounds\HighwayToHell.ogg,0.9,1};
        titles[] = {};
    };
    class soundair
    {
        name="soundair";
        sound[]={sounds\Top Gun.ogg,0.9,1};
        titles[] = {};
    };
};

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Love this little mod, But I want to be able to stop the audio and also keep it from playing it overlapping if the player spams the play button - did anyone ever come up with the right code to make an off button or at least keep the audio from being able to overlap if played more than once? Subscribing....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...