mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-19 01:52:00 +03:00
Kill and eject players from all vehicle types except boats
The code in the CH53 SFX file must remain there. Boats/ships do not properly call the destruction EH files so this fix doesn't work for them. maybe a killed event handler must be added from the server?
This commit is contained in:
@@ -5,21 +5,6 @@ _int = (fuel _v)*(8+random 2);
|
|||||||
_t=time;
|
_t=time;
|
||||||
|
|
||||||
if (!isDedicated) then { //dw, particle stuff don't need run on dedicated
|
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 = "#particlesource" createVehicleLocal getPosATL _v;
|
||||||
_fl attachto [_v,[0,0,0],"destructionEffect2"];
|
_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];
|
_fl setParticleRandom [0.3, [1, 1, 0], [0, 0, 0], 0, 0.3, [0, 0, 0, 0], 0, 0];
|
||||||
|
|||||||
@@ -1,24 +1,40 @@
|
|||||||
private ["_v","_int","_t","_b"];
|
private ["_v","_int","_t","_b"];
|
||||||
_v=_this select 0;
|
_v=_this select 0;
|
||||||
if (_v iskindof "helicopter" || _v iskindof "plane")
|
_KillEject = { //leave as local compile for a tiny bit more security
|
||||||
then
|
_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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (_v iskindof "helicopter" || _v iskindof "plane") then {
|
||||||
|
if (player in (crew _v)) then {
|
||||||
|
[] spawn _KillEject;
|
||||||
|
};
|
||||||
//_v setVehicleInit "[this] spawn BIS_Effects_AirDestruction";
|
//_v setVehicleInit "[this] spawn BIS_Effects_AirDestruction";
|
||||||
//processInitCommands; //ClearvehicleInit done at end of burn script
|
//processInitCommands; //ClearvehicleInit done at end of burn script
|
||||||
["AirDestruction", _v] call BIS_Effects_globalEvent;
|
["AirDestruction", _v] call BIS_Effects_globalEvent;
|
||||||
|
};
|
||||||
|
if (_v iskindof "tank") then {
|
||||||
|
if (player in (crew _v)) then {
|
||||||
|
[] spawn _KillEject;
|
||||||
};
|
};
|
||||||
if (_v iskindof "tank")
|
|
||||||
then
|
|
||||||
{
|
|
||||||
_int = (fuel _v)*(2+random 2);
|
_int = (fuel _v)*(2+random 2);
|
||||||
_t = time;
|
_t = time;
|
||||||
//_v setVehicleInit format ["[this, %1, %2]spawn BIS_Effects_Burn",_int, _t]; - disabled to prepaire for move into engine
|
//_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
|
//processInitCommands; //ClearvehicleInit done at end of burn script
|
||||||
[_v,_int] spawn BIS_Effects_Secondaries;
|
[_v,_int] spawn BIS_Effects_Secondaries;
|
||||||
|
};
|
||||||
|
if (_v iskindof "car" || _v iskindof "ship")then {
|
||||||
|
if (player in (crew _v)) then {
|
||||||
|
[] spawn _KillEject;
|
||||||
};
|
};
|
||||||
if (_v iskindof "car" || _v iskindof "ship")
|
|
||||||
then
|
|
||||||
{
|
|
||||||
_int = (fuel _v)*(2 + random 1);
|
_int = (fuel _v)*(2 + random 1);
|
||||||
_t = time;
|
_t = time;
|
||||||
|
|
||||||
@@ -31,4 +47,4 @@ if (_v iskindof "car" || _v iskindof "ship")
|
|||||||
{
|
{
|
||||||
_b = createVehicle ["SmallSecondary", (getPosATL _v), [], 0, "CAN_COLLIDE"];
|
_b = createVehicle ["SmallSecondary", (getPosATL _v), [], 0, "CAN_COLLIDE"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user