mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-24 00:50:50 +03:00
Should fix BIS_Effect eject/kill
excludes cars now
This commit is contained in:
@@ -1,60 +1,28 @@
|
||||
private ["_v","_int","_t","_b","_KillEject"];
|
||||
private ["_v","_int","_t","_b"];
|
||||
_v=_this select 0;
|
||||
_KillEject = { //leave as local compile for a tiny bit more security
|
||||
private ["_cancel","_radius","_SZPos"];
|
||||
_cancel = false;
|
||||
{
|
||||
_SZPos = _x select 0;
|
||||
_radius = _x select 1;
|
||||
if ((isInTraderCity || !canbuild) && {(player distance _SZPos) < _radius}) then {_cancel = true;};
|
||||
} count DZE_SafeZonePosArray;
|
||||
player action ["getOut",vehicle player]; //eject player so their gear is accessible if dead and they aren't stuck in wreck if alive
|
||||
if (!_cancel) then {
|
||||
sleep 0.01; //don't use uisleep here
|
||||
[player, "explosion"] spawn player_death;
|
||||
};
|
||||
};
|
||||
if (!DZE_NoVehicleExplosions) then {
|
||||
if (_v iskindof "helicopter" || _v iskindof "plane") then {
|
||||
if (player in (crew _v)) then {
|
||||
[] spawn _KillEject;
|
||||
};
|
||||
//_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;
|
||||
["Eject", _v] call BIS_Effects_globalEvent;
|
||||
};
|
||||
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);
|
||||
_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;
|
||||
|
||||
//Possible initial explosion
|
||||
["Eject", _v] call BIS_Effects_globalEvent;
|
||||
if ((random _int)>2.2) then
|
||||
{
|
||||
_b = createVehicle ["SmallSecondary", (getPosATL _v), [], 0, "CAN_COLLIDE"];
|
||||
_b = createVehicle ["SmallSecondary", (getPosATL _v), [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_isVeh = (_v iskindof "helicopter" || _v iskindof "plane" || _v iskindof "tank" || _v iskindof "car" || _v iskindof "ship");
|
||||
if (_isVeh) then {
|
||||
if (player in (crew _v)) then {
|
||||
[] spawn _KillEject;
|
||||
};
|
||||
if (_isVeh && {player in (crew _v)}) then {
|
||||
["Eject", _v] call BIS_Effects_globalEvent;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user