Kill and eject player when their vehicle explodes

Previous changes to the destruction effects file broke previous fixes
that resolved the world is on fire glitch. I reverted those in this
commit.

Note: the CH53 is still broken in this commit
This commit is contained in:
icomrade
2016-04-26 14:47:52 -04:00
parent 16c81e7ce2
commit ec7351dbbc
4 changed files with 17 additions and 12 deletions

View File

@@ -81,6 +81,7 @@
[FIXED] Reworked death messages. Fixed messages not always showing, undefined errors and wrong distance bug. Added bled out, killed by zombie, etc. MPHit event handler (fnc_plyrHit) is no longer needed. @ebaydayz
[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
[UPDATED] .hpp files updated in dayz_epoch_b CfgLootPos > CfgBuildingPos. @Uro1
[UPDATED] .bat files updated in Config-Examples @Raziel23x

View File

@@ -5,7 +5,13 @@ _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
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];
@@ -31,9 +37,7 @@ _tv=11;
//Remove weapons/ammo to prevent explosion. Script will create its own explosions (doesnt work?)
removeallweapons _v;
if((local _v) AND (_v isKindOf"Air") )then{
_expl=createVehicle["HelicopterExploSmall",(getPosATL _v),[],0,"CAN_COLLIDE"];
};
if (local _v) then {_expl=createVehicle ["HelicopterExploSmall", (getPosATL _v), [], 0, "CAN_COLLIDE"];};
if (!isDedicated) then { //dw, particle stuff don't need run on dedicated
while {_i <1200 && ((velocity _v select 2)<-20 || (getPosATL _v select 2)>8) && !(alive _v) && !(isnull _v) && (getPosATL _v select 2)>1} do
@@ -43,7 +47,7 @@ if (_tv>2) then {_dr=1/_tv} else {_dr=1};
_fl setDropInterval _dr;
_sm setDropInterval _dr;
_i=_i+1;
uiSleep 0.2;
sleep 0.2;
};
}; // end of dedicated check
@@ -74,7 +78,7 @@ if (!isDedicated) then { //dw, particle stuff don't need run on dedicated
_splash setparticlecircle [2,[0,3,15]];
_splash setDropInterval 0.002;
uiSleep 0.2;
sleep 0.2;
deletevehicle _wave;deletevehicle _splash;
}; // end of dedicated check
/*
@@ -113,7 +117,7 @@ else
_velz=velocity _v select 2;
if (_velz>1) then {_v setvelocity [velocity _v select 0,velocity _v select 1,0]};
_expl = createVehicle ["HelicopterExploBig", [_pos select 0,_pos select 1,(_pos select 2) + 1], [], 0, "CAN_COLLIDE"];
uiSleep 0.05;
sleep 0.05;
/*
_wreck=GetText (configFile >> "CfgVehicles" >> (typeof _v) >> "wreck");
if (_wreck!="") then
@@ -128,7 +132,7 @@ else
deleteVehicle _v;
_v =(_wreck) createvehicle _pos;
{_x moveincargo _v} foreach _crw;
//uiSleep 0.05;
//sleep 0.05;
_v setvelocity _vel;
//_v setPos _pos;
_v setvectordir (_dir);

View File

@@ -66,7 +66,7 @@ _dirt setDropInterval 0.05;
_dirt setDropInterval _dr;
//_shards setDropInterval _dr;
uiSleep (0.25 - (_speed / 1000));
sleep (0.25 - (_speed / 1000));
_i = _i + 1;
};
deleteVehicle _smoke;
@@ -84,5 +84,5 @@ if (local _v) then
["Burn", _v, _int, _t] call BIS_Effects_globalEvent;
[_v,_int,false] spawn BIS_Effects_Secondaries;
};
uiSleep 0.5;
sleep 0.5;
_v setvelocity [0,0,-0.01];

View File

@@ -21,7 +21,7 @@ while {_int>1} do
};
{
uiSleep _x;
sleep _x;
if((_lifecheck&&(alive _v))||(isnull _v)||(((getposASL _v)select 2)<0))exitwith{};
"SmallSecondary" createvehicle(_v modelToWorld _effect2pos);
createVehicle ["SmallSecondary", (_v modelToWorld _effect2pos), [], 0, "CAN_COLLIDE"];
}foreach(_list);