2015-01-14 02:00:48 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-11 04:51:07 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2015-01-13 04:17:52 +00:00
|
|
|
GVAR(currentDeafness) = 0;
|
|
|
|
GVAR(newStrength) = 0;
|
2015-04-20 07:17:47 +00:00
|
|
|
GVAR(playerVehAttenuation) = 1;
|
2015-01-13 04:17:52 +00:00
|
|
|
|
|
|
|
// Spawn volume updating process
|
2015-01-14 02:16:55 +00:00
|
|
|
[FUNC(updateVolume), 0.1, [] ] call CBA_fnc_addPerFrameHandler;
|
2015-04-11 04:21:54 +00:00
|
|
|
|
2015-04-11 04:51:07 +00:00
|
|
|
//Update veh attunation when player veh changes
|
2015-04-20 07:17:47 +00:00
|
|
|
["playerVehicleChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler);
|
|
|
|
["playerTurretChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler);
|
2015-06-05 21:37:27 +00:00
|
|
|
|
|
|
|
//Reset deafness on respawn (or remote control player switch)
|
|
|
|
["playerChanged", {
|
|
|
|
GVAR(currentDeafness) = 0;
|
|
|
|
GVAR(newStrength) = 0;
|
|
|
|
}] call EFUNC(common,addEventhandler);
|