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

Very neat little snippet. I love small details like this that gives each server it's own little touch.

 

I noticed this script only plays the sound locally. Anyone know how one would go about to make the sound play for everyone in the vicinity?

_sounddist = 20;
_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
Link to comment
Share on other sites

  • 0

Sound which is in my case "lock" has to be defined in description.ext under class CfgSounds. You can set audible range in CfgSounds and after that range sound starts fading, the farther you go from the vehicle. Here is how I do it in local_lockUnlock.sqf. This way you don't need to be the "owner" of the car to play that sound, like it's in OP and doesn't play the sound before you get on driver seat once.

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

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",true,true];
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", 50] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
		titleText ["LOCKED = Can not be lifted or towed","PLAIN DOWN"]; titleFadeOut 4;
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",false,true];
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", 50] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
		titleText ["UNLOCKED = Can be lifted or towed","PLAIN DOWN"]; titleFadeOut 4;
	};
};
Link to comment
Share on other sites

  • 0

 

Sound which is in my case "lock" has to be defined in description.ext under class CfgSounds. You can set audible range in _sounddist and after that range sound starts fading, the farther you go from the vehicle. Here is how I do it in local_lockUnlock.sqf. This way you don't need to be the "owner" of the car to play that sound, like it's in OP and doesn't play the sound before you get on driver seat once.

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];
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
		titleText ["LOCKED = Can not be lifted or towed","PLAIN DOWN"]; titleFadeOut 4;
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",false,true];
		player action ["lightOn", _vehicle];
		_nul = [objNull, _vehicle, rSAY, "lock", _sounddist] call RE;
		sleep 0.5;
		player action ["lightOff", _vehicle];
		titleText ["UNLOCKED = Can be lifted or towed","PLAIN DOWN"]; titleFadeOut 4;
	};
};

 

Works great man!

Link to comment
Share on other sites

  • 0

Seems that people can hear the sound from 500-600m away :o

 

:)  How much you have volume for that sound in CfgSounds?

 

{

        name = "lock";

        sound[] = {Scripts\sounds\lock.ogg,0.2 <-- this one here ,1};

        titles[] = {};

};

Link to comment
Share on other sites

  • 0

can anyone share there sound effect for this? im having trouble finding something i like.

tried getting one from altislife but keep getting error

 

cheers

I'm pretty happy with mine. Took two seperate sounds off some free audio site and used Audacity to merge it and trim it down. So shoutout two the guys who jingled his keys and unlocked his car in front of audio recorders and put it online.

 

You can download it here.

Link to comment
Share on other sites

  • 0

hi thanks for that credible but something aint working. i just get  a small media player box pop up and when i press play nothing happens :(

It's an .ogg format which I guess not all media players support. Either open it with a multi-format media player like VLC or implement the script and try it out ingame.

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...