Jump to content
  • 0

car sound when unlocking your vehicle


Eugene

Question

Hi all.

by the requests of people...

I show how it done on my local server (with my folder paths), replace it with yours.

1. Find your desirable sound and convert it to OGG format - in my example it is signalka.OGG. Place this file in to MPMission folder : D:\SteamGamesLibrary\SteamApps\common\arma 2 operation arrowhead\MPMissions\DayZ_Epoch_24.Napf\signalka.ogg

 

2. add to D:\SteamGamesLibrary\SteamApps\common\arma 2 operation arrowhead\MPMissions\DayZ_Epoch_24.Napf\description.ext  reference to  new sound file : http://pastebin.com/P1FYvLjy

 

3. Almost all of you use scripts like selfbloodbags , then you have script fn_selfActions.sqf in your MPMission,

3.1. Extract scripts lock_veh.sqf and unlock_veh.sqf from dayz_code.pbo to  (in my case it D:\SteamGamesLibrary\SteamApps\common\arma 2 operation arrowhead\MPMissions\DayZ_Epoch_24.Napf\Scripts )

3.2. in your MPMissions fn_selfActions.sqf replace references to extracted scripts (lock_veh.sqf and unlock_veh.sqf).

Part of new fn_selfActions.sqf :   http://pastebin.com/QgHM4k5e

 

4. Modify extracted scripts lock_veh.sqf and unlock_veh.sqf like this:

lock: http://pastebin.com/v7EiUerT

unlock: http://pastebin.com/n8JYivtq

 

5. start server.

 

Additional bonus - car lights will be flash when car lock\unlock

 

 

 

PS: sorry for my english.

 

Link to comment
Share on other sites

Recommended Posts

  • 0

 

class CfgSounds
{
    sounds[] =  {carlock};
class carlock
{
name = "carlock";
sound[] = {carlock.ogg,0.2,1};
titles[] = {};
}; 
};

 

 

This is mine and it plays double for the person unlocking

 

 

class CfgSounds

{
    sounds[] = {siren,Carlock};
    class siren
    {
name = "siren";
sound[] = {Custom\siren.ogg,0.5,1};
titles[] = {};
    };
class Carlock
        {
                name = "Carlock";
                sound[] = {Custom\unlocksound\carlock.ogg,0.2,1};
                titles[] = {};
        };
       
};
Link to comment
Share on other sites

  • 0

There are some bugs i experience with this modification.

 

1. The sound plays only for the player who unlock/lock the vehicle

2. THe Intro Sound does not work with this one.

 

Any ideas so others can hear that beep sound and not only the one who opens locks it?

 

Greets

Link to comment
Share on other sites

  • 0

Local_Lockunlock.sqf 

private ["_vehicle","_status","_sounddist"];
_vehicle = _this select 0;
_status = _this select 1;
_sounddist = 20;

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "carlock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "carlock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	};
};

Description.ext

class CfgSounds
{
    sounds[] = {carlock};
	class carlock
	{
		name = "carlock";
		sound[] = {carlock.ogg,0.2,1};
		titles[] = {};
	};	
};
Link to comment
Share on other sites

  • 0

 

Local_Lockunlock.sqf 

private ["_vehicle","_status","_sounddist"];
_vehicle = _this select 0;
_status = _this select 1;
_sounddist = 20;

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "carlock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "carlock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	};
};

Description.ext

class CfgSounds
{
    sounds[] = {carlock};
	class carlock
	{
		name = "carlock";
		sound[] = {carlock.ogg,0.2,1};
		titles[] = {};
	};	
};

 

Mine is the same but it plays the sound twice for the person who unlocks it any help?

Link to comment
Share on other sites

  • 0

change this 

PVDZE_veh_Lock = [_vehicle,false];
if(player distance _vehicle < 10) then {
        if (local _vehicle) then {
                PVDZE_veh_Lock spawn local_lockUnlock
        } else {
                publicVariable "PVDZE_veh_Lock";
        };
       
        cutText [format["%1 использован чтобы открыть транспорт %2 ",_key, getText (configFile >> "CfgVehicles" >> _typeOfVehicle >> "displayName")], "PLAIN"];
};

to this

PVDZE_veh_Lock = [_vehicle,false];
if(player distance _vehicle < 10) then {
        if (local _vehicle) then {
                PVDZE_veh_Lock spawn local_lockUnlock
        } else {
                publicVariable "PVDZE_veh_Lock";
        };
       
      cutText [format["%1 used to unlock vehicle. %2 ",_key, getText (configFile >> "CfgVehicles" >> _typeOfVehicle >> "displayName")], "PLAIN"];
};
 

in your unlock file  :P

Link to comment
Share on other sites

  • 0

Does your sound play twice if you u lock a vehicle and does it play to other people?

 

I am already using what you posted FYI

my sound plays once wenn i open it and wenn i close it . And yes everybody can hear it it a distance of around 20 meters

i'm using this sound 

Link to comment
Share on other sites

  • 0

Could you post both your description.ext and your other lock files please?

in your custom compiles.sqf change
local_lockUnlock =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf";

to

local_lockUnlock =			compile preprocessFileLineNumbers "custom\local_lockUnlock.sqf";

in local_lockUnlock.sqf

private ["_vehicle","_status","_sounddist"];
_vehicle = _this select 0;
_status = _this select 1;
_sounddist = 20;

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",true,true]; // if you have R3F TOW/LIFT
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",false,true];// if you have R3F TOW/LIFT
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	};
};

copy all and paste in yours

 

in description.ext set this 

class lock
    {
    name="lock";
    sound[]={sounds\lock.ogg,0.2,1};
    titles[] = {};
};

between the other sounds like this

class CfgSounds 
{
  sounds[] = {drink_water,playerSnoring,hero,danceMusic,siren,fastrope,lock};   
  class drink_water 
  {
    name="drink_water";
    sound[]={sounds\drink_water.ogg,0.2,1};
    titles[] = {};
  };
  class playerSnoring 
  {
    name="playerSnoring";
    sound[]={sounds\snoring.ogg,0.5,1};
    titles[] = {};
 };
  class fastrope
    {
    name="fastrope";
    sound[]={sounds\fastrope.ogg,0.9,1};
    titles[] = {};
	};
  class lock
    {
    name="lock";
    sound[]={sounds\lock.ogg,0.2,1};
    titles[] = {};
};
  class hero
    {
    name="hero";
    sound[]={sounds\hero.ogg,0.9,1};
    titles[] = {};
};
   class siren
    {
    name="siren";
    sound[]={sounds\siren.ogg,0.9,1};
    titles[] = {};
};
};

thats it

Link to comment
Share on other sites

  • 0

 

in your custom compiles.sqf change
local_lockUnlock =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf";

to

local_lockUnlock =			compile preprocessFileLineNumbers "custom\local_lockUnlock.sqf";

in local_lockUnlock.sqf

private ["_vehicle","_status","_sounddist"];
_vehicle = _this select 0;
_status = _this select 1;
_sounddist = 20;

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",true,true]; // if you have R3F TOW/LIFT
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",false,true];// if you have R3F TOW/LIFT
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
	};
};

copy all and paste in yours

 

in description.ext set this 

class lock
    {
    name="lock";
    sound[]={sounds\lock.ogg,0.2,1};
    titles[] = {};
};

between the other sounds like this

class CfgSounds 
{
  sounds[] = {drink_water,playerSnoring,hero,danceMusic,siren,fastrope,lock};   
  class drink_water 
  {
    name="drink_water";
    sound[]={sounds\drink_water.ogg,0.2,1};
    titles[] = {};
  };
  class playerSnoring 
  {
    name="playerSnoring";
    sound[]={sounds\snoring.ogg,0.5,1};
    titles[] = {};
 };
  class fastrope
    {
    name="fastrope";
    sound[]={sounds\fastrope.ogg,0.9,1};
    titles[] = {};
	};
  class lock
    {
    name="lock";
    sound[]={sounds\lock.ogg,0.2,1};
    titles[] = {};
};
  class hero
    {
    name="hero";
    sound[]={sounds\hero.ogg,0.9,1};
    titles[] = {};
};
   class siren
    {
    name="siren";
    sound[]={sounds\siren.ogg,0.9,1};
    titles[] = {};
};
};

thats it

 

 

Ok thanks for posting that but for me the sound doesn't play say if i stand next to someone that unlocks their car?

Link to comment
Share on other sites

  • 0

Could there be a problem with your script and the hotwire kit? I get a message since i installed this telling me scripts/hotwire_veh.sqf not found when i try to hotwire a car.

Please have a look into it...thx

check the selfaction file for this part

 if(_hasHotwireKit) then {
//ZEV lock ->
// _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
   _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "scripts\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
//ZEV lock <-                                          
                                        } else {

change it to this

 if(_hasHotwireKit) then {
//ZEV lock ->
   _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
// _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "scripts\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
//ZEV lock <-                                          
                                        } else {

change the  // for _Unlock = player addAction

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
×
×
  • Create New...