Jump to content

Vehicle HiFi for 1.0.6.1


Anhor

Recommended Posts

A small and easy mod for 1.0.6.1

What it does? It adds another point to the scroll menue while sitting in a vehicle. If you select this point you can have a song played (Car Stereo)

1. Pick a song you love in .ogg format.

2. Create a new .sqf file and insert that:

playSound "mysong";
systemChat("Play that funky music!");

Save the file under any name, i.e. carmusic.sqf

2. Create a new folder in your mission root and call it i.e. "custom"

3. Upload carmusic.sqf to this folder

4. Upload your .ogg file in this folder too

5. Now  in your description.ext FIND:

aiKills = 1;
diagRadio = 1;
diagHit = 1;

BELOW paste:

class CfgSounds
{
flysound[] =
    {
    mysong
    };
    class mysong
    {
    name="mysong";
    sound[]={custom\mysong.ogg,0.9,1};
    titles[] = {};
    };    
    };

6. Last step! Iin fn_selfactions.sqf ADD:

if (_inVehicle && (driver _vehicle == player)) then {

    if (s_player_sounds < 0) then {
        dayz_sounds = _vehicle;
        s_player_sounds = dayz_sounds addaction[("<t color=""#F7D708"">" + ("Play Song") +"</t>"),"custom\carmusic.sqf"];  
        };
    } else {
    
        dayz_sounds removeAction s_player_sounds;
        s_player_sounds = -1;
    }; 

right BELOW of this:

if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

Thats it!

I am really only thinking of the idea and the concept, juandayz help me with the code. So pay him the honor.

Link to comment
Share on other sites

i think you also can add a video on gps using the same way:

playmovie.sqf (drop it into custom folder)

  Reveal hidden contents

make a movie file called gps.ogv (.ogv  format) (must be droped into custom folder)

now in fn_selfactions to get music and video option

  Reveal hidden contents

 

Link to comment
Share on other sites

Is there a way to make it stop playing the song if you get out of the vehicle? As currently it will continue to play until over. Also what about if you had two songs set could you make it stop playing one when you select the other? :)

Link to comment
Share on other sites

  On 3/19/2017 at 12:54 AM, Hriki said:

Is there a way to make it stop playing the song if you get out of the vehicle? As currently it will continue to play until over. Also what about if you had two songs set could you make it stop playing one when you select the other? :)

Expand  

i guess you will need an extra sqf.  something like this.

In custom fn_selfactions.sqf  replace this:

  Reveal hidden contents

by:

  Reveal hidden contents

Now replace the carmusic.sqf by this code:

  Reveal hidden contents

now in the same folder where carmusic.sqf is locate.. create this new sqf called carmusicoff.sqf

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 3/19/2017 at 1:30 AM, juandayz said:

i guess you will need an extra sqf.  something like this.

In custom fn_selfactions.sqf  replace this:

  Reveal hidden contents

by:

  Reveal hidden contents

Now replace the carmusic.sqf by this code:

  Reveal hidden contents

now in the same folder where carmusic.sqf is locate.. create this new sqf called carmusicoff.sqf

  Reveal hidden contents

 

Expand  

Thanks for the reply man! I tried this out but now when I play the song the sound goes crazy and my game locks up/crashes? Any ideas?

Link to comment
Share on other sites

mmm try change the carmusicoff.sqf

by

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 3/19/2017 at 5:56 AM, juandayz said:

mmm try change the carmusicoff.sqf

by

  Reveal hidden contents

 

Expand  

Unfortunately no luck! It still comes out scrambled and locks my game up :/ 

Link to comment
Share on other sites

Never change a running system :wink:

By myself I use this option not for 30 seconds in and outs. Mostly I use this for flying ...... and a song last for 3 or 4 minutes ....... so it´s no prob, the song ends long bevor I land .......

Link to comment
Share on other sites

  On 3/19/2017 at 8:09 AM, Hriki said:

Unfortunately no luck! It still comes out scrambled and locks my game up :/ 

Expand  

its very strange that cause a game crash.. if u go back to the first version.. the game works again?  do you have any kind of error on your rpt about this script?  you said "the sound goes crazy" this means a constant loop whit the song? i ask you cuz i cannot test since i uninstall my test server 

Link to comment
Share on other sites

from the bistudio wiki

Known restrictions
Filesize: max. 50 KB (beside possible server-side restrictions)
Filetype: OGG
Sampling rate of 44.1 kHz is OK.
Stereo isn't really needed, and as benefit mono will reduce filesize
For simulated radio transmissions 16 Bit sampling format is best. For better quality stay with 32 Bit, but consider the bigger filesize.

 

Link to comment
Share on other sites

  On 3/19/2017 at 5:38 PM, juandayz said:

its very strange that cause a game crash.. if u go back to the first version.. the game works again?  do you have any kind of error on your rpt about this script?  you said "the sound goes crazy" this means a constant loop whit the song? i ask you cuz i cannot test since i uninstall my test server 

Expand  

Thanks for the replies guys! The sound is hard to explain. Have you ever had a computer hang when playing a song? That sharp distorted sound that shrieks out is kind of what happens. It works fine with the original method plays absolutely fine. I am wondering if maybe via this method I am running into the limitations kingpapawawa mentioned about ogg files, or a driver issue? Not sure as it played fine with the original method. 

Link to comment
Share on other sites

  On 3/21/2017 at 1:00 PM, Cherdenko said:

@juandayz i remember the sexy video you had on the gps as an old script of yours... that was kinda funny :biggrin:

Expand  

Download and drop into your custom\script\   http://www.mediafire.com/download/6fiknw6aassaxpw/erotic.zip

*Go to your extra_rc.hpp and add:

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 1 month later...
  On 4/28/2017 at 9:48 AM, .-=Franky=-. said:

Can anyone hear the song or just the driver?

Expand  
playSound "mysong";

playsound: just the driver hear

_nul = [objNull, player, rSAY, "mysong"] call RE;

everyone hear.

 

_soundList = ["mysong","putothersSongs"] call BIS_fnc_selectRandom;
_sounddist=50;//mts around
[nil,player,rSAY,[_soundList, _sounddist]] call RE;

another variant

Link to comment
Share on other sites

I got an error 

  Reveal hidden contents

It spam´s my ArmA2OA.rpt with hundrets of  that errors

Link to comment
Share on other sites

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 5/1/2017 at 4:52 PM, Kimarik said:

Is it possible to make one sound only for bikes, one for land vehicle and one for Air vehicle?

I want to have Bycile Race from Queen for bikes, Highway to Hell from ACDC for landvehicle and Topgun sound for Airvehicles.

Expand  

 

//bikes

_isbike = typeOf _vehicle in ["bikeidhere"];

if (_inVehicle && _isbike && (driver _vehicle == player)) then {  soundcode here};

//air

if (_inVehicle && {_vehicle isKindOf "Air"} && (driver _vehicle == player)) then { //soundcode here};

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...