diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index 53273e7f2..dbb69a7be 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -82,6 +82,7 @@ [FIXED] Player no longer hears radiation sound when changing clothes. @ebaydayz [FIXED] Ponds and lakes are now detected correctly in player_goFishing. #1678 @ebaydayz [FIXED] Players are now ejected and killed when their vehicle is destroyed. @icomrade +[FIXED] CH53_DZE now explodes and kills passengers upon destruction. @icomrade [UPDATED] .hpp files updated in dayz_epoch_b CfgLootPos > CfgBuildingPos. @Uro1 [UPDATED] .bat files updated in Config-Examples @Raziel23x diff --git a/SQF/dayz_code/Configs/CfgVehicles/Helicopter/CH53.hpp b/SQF/dayz_code/Configs/CfgVehicles/Helicopter/CH53.hpp index a8df6e5f3..35d19e76c 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Helicopter/CH53.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Helicopter/CH53.hpp @@ -6,6 +6,7 @@ class CH53_DZE : USEC_ch53_E { displaynameshort = "CH53_DZE"; destrType = "DestructWreck"; enablemanualfire = 0; + secondaryExplosion = -1; crew = ""; soundGetIn[] = {"\ca\Sounds\Air\Noises\heli_door_01",0.316228,1}; soundGetOut[] = {"\ca\Sounds\Air\Noises\heli_door_01",0.316228,1,30}; @@ -28,4 +29,8 @@ class CH53_DZE : USEC_ch53_E { transportMaxMagazines = 80; transportmaxbackpacks = 15; fuelCapacity = 3849; + class eventhandlers { + GetIn = "if ((_this select 2) == player) then {MonitorVM = [_this select 0] execvm '\usec_ch53\scripts\ch53_monitor.sqf';};"; + init = "MonitorVM = [_this select 0] execvm '\usec_ch53\scripts\ch53_monitor.sqf';MonitorSFXVM = [_this select 0] execvm '\z\addons\dayz_code\system\CH53\ch53_monitorSFX.sqf';"; + }; }; \ No newline at end of file diff --git a/SQF/dayz_code/system/CH53/ch53_monitorSFX.sqf b/SQF/dayz_code/system/CH53/ch53_monitorSFX.sqf new file mode 100644 index 000000000..e0da4da88 --- /dev/null +++ b/SQF/dayz_code/system/CH53/ch53_monitorSFX.sqf @@ -0,0 +1,74 @@ +_vehicle = _this select 0; +_wait = 0.5; + +//Initiate Variables + _RampSound = false; + _gearDown = true; + _gearSound = false; + _vehicle setVariable ["HydraulicsFailure",false, false]; + _vehicle setVariable ["EngineFailure",false, false]; + _vehicle setVariable ["AvionicsFailure",false, false]; + +//Overall Event Handlers +_EHDamageIdx = _vehicle addEventHandler ["Dammaged",{ + if ((_this select 2) > 0.8 ) then { + switch (_this select 1) do { + case "mala vrtule": {_this select 0 setVariable ["HydraulicsFailure",true, true];}; + case "velka vrtule": {_this select 0 setVariable ["HydraulicsFailure",true, true];}; + case "motor": {_this select 0 setVariable ["EngineFailure",true, true];}; + case "elektronika": {_this select 0 setVariable ["AvionicsFailure",true, true];}; + }; + }; +}]; + +while {(alive _vehicle)} do { + // SINGLE // Ramp Sound Effect + if((_vehicle animationPhase "ramp_bottom" > 0) && !(_RampSound)) then { + _vehicle say ["ch53_rampdown",5]; + _RampSound = true; + sleep 3; + }; + + // SINGLE // Ramp Sound Effect + if((_vehicle animationPhase "ramp_bottom" < 1) && !(_vehicle animationPhase "ramp_bottom" == 0.56) && (_RampSound)) then { + _vehicle say ["ch53_rampup",5]; + _RampSound = false; + sleep 3; + }; + + // SINGLE // Gear Sound Effect + if((_vehicle animationPhase "gear_nose_1" > 0) && !(_gearSound) && (_gearDown)) then { + _vehicle say ["ch53_gear",5]; + _gearSound = true; + }; + + // SINGLE // Gear Sound Effect + if((_vehicle animationPhase "gear_nose_1" < 1) && (_gearSound) && !(_gearDown)) then { + _vehicle say ["ch53_gear",5]; + _gearSound = false; + }; + + if (player in (crew _vehicle)) then { + // INFO // SINGLE // Gear Down + if((_vehicle animationPhase "gear_nose_1" == 0) && !(_gearDown)) then { + _vehicle vehicleRadio "dws_info_geardown"; + _gearDown = true; + sleep 3; + }; + + // INFO // SINGLE // Gear Up + if((_vehicle animationPhase "gear_nose_1" == 1) && (_gearDown)) then { + _vehicle vehicleRadio "dws_info_gearup"; + _gearDown = false; + sleep 3; + }; + }; + + if(player in (crew _vehicle)) then {sleep _wait;} else {sleep (_wait * 4);}; +}; +if (player in (crew _vehicle) && (!alive _vehicle)) then { + player action ["Eject",vehicle player]; //eject player so I can get their gear + sleep 0.01; //don't use uisleep here + [player, "explosion"] spawn player_death; //kill player +}; +_vehicle removeAllEventHandlers "Dammaged"; \ No newline at end of file