diff --git a/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf b/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf index 15ec2104c..5fd1fde94 100644 --- a/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf +++ b/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf @@ -5,21 +5,6 @@ _int = (fuel _v)*(8+random 2); _t=time; if (!isDedicated) then { //dw, particle stuff don't need run on dedicated - if (player in (crew _v)) then { - [] spawn { //kill players when their vehicle explodes since this is too difficult for ArmA on its own - _cancel = false; - { - _SZPos = _x select 0; - _radius = _x select 1; - if ((isInTraderCity || !canbuild) && {(player distance _SZPos) < _radius}) then {_cancel = true;}; - } count DZE_SafeZonePosArray; - if (!_cancel) 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; - }; - }; - }; _fl = "#particlesource" createVehicleLocal getPosATL _v; _fl attachto [_v,[0,0,0],"destructionEffect2"]; _fl setParticleRandom [0.3, [1, 1, 0], [0, 0, 0], 0, 0.3, [0, 0, 0, 0], 0, 0]; diff --git a/SQF/dayz_code/system/BIS_Effects/killed.sqf b/SQF/dayz_code/system/BIS_Effects/killed.sqf index 2318fdc3e..099eac9e2 100644 --- a/SQF/dayz_code/system/BIS_Effects/killed.sqf +++ b/SQF/dayz_code/system/BIS_Effects/killed.sqf @@ -1,34 +1,50 @@ private ["_v","_int","_t","_b"]; _v=_this select 0; -if (_v iskindof "helicopter" || _v iskindof "plane") - then +_KillEject = { //leave as local compile for a tiny bit more security + _cancel = false; { - //_v setVehicleInit "[this] spawn BIS_Effects_AirDestruction"; - //processInitCommands; //ClearvehicleInit done at end of burn script - ["AirDestruction", _v] call BIS_Effects_globalEvent; + _SZPos = _x select 0; + _radius = _x select 1; + if ((isInTraderCity || !canbuild) && {(player distance _SZPos) < _radius}) then {_cancel = true;}; + } count DZE_SafeZonePosArray; + if (!_cancel) 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; }; -if (_v iskindof "tank") - then - { - _int = (fuel _v)*(2+random 2); - _t = time; - //_v setVehicleInit format ["[this, %1, %2]spawn BIS_Effects_Burn",_int, _t]; - disabled to prepaire for move into engine - //processInitCommands; //ClearvehicleInit done at end of burn script - [_v,_int] spawn BIS_Effects_Secondaries; +}; +if (_v iskindof "helicopter" || _v iskindof "plane") then { + if (player in (crew _v)) then { + [] spawn _KillEject; }; -if (_v iskindof "car" || _v iskindof "ship") - then - { - _int = (fuel _v)*(2 + random 1); - _t = time; + //_v setVehicleInit "[this] spawn BIS_Effects_AirDestruction"; + //processInitCommands; //ClearvehicleInit done at end of burn script + ["AirDestruction", _v] call BIS_Effects_globalEvent; +}; +if (_v iskindof "tank") then { + if (player in (crew _v)) then { + [] spawn _KillEject; + }; + _int = (fuel _v)*(2+random 2); + _t = time; + //_v setVehicleInit format ["[this, %1, %2]spawn BIS_Effects_Burn",_int, _t]; - disabled to prepaire for move into engine + //processInitCommands; //ClearvehicleInit done at end of burn script + [_v,_int] spawn BIS_Effects_Secondaries; +}; +if (_v iskindof "car" || _v iskindof "ship")then { + if (player in (crew _v)) then { + [] spawn _KillEject; + }; + _int = (fuel _v)*(2 + random 1); + _t = time; - //_v setVehicleInit format ["[this, %1, %2]spawn BIS_Effects_Burn; ",_int, _t]; - disabled to prepaire for move into engine - //processInitCommands; //ClearvehicleInit done at end of burn script - [_v,_int] spawn BIS_Effects_Secondaries; + //_v setVehicleInit format ["[this, %1, %2]spawn BIS_Effects_Burn; ",_int, _t]; - disabled to prepaire for move into engine + //processInitCommands; //ClearvehicleInit done at end of burn script + [_v,_int] spawn BIS_Effects_Secondaries; - //Possible initial explosion - if ((random _int)>2.2) then - { - _b = createVehicle ["SmallSecondary", (getPosATL _v), [], 0, "CAN_COLLIDE"]; - }; + //Possible initial explosion + if ((random _int)>2.2) then + { + _b = createVehicle ["SmallSecondary", (getPosATL _v), [], 0, "CAN_COLLIDE"]; }; +};