mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Add option to exempt players in safezones from EVR effects
This commit is contained in:
@@ -389,9 +389,14 @@ fnc_evr = {
|
||||
|
||||
local _vehicle = vehicle player;
|
||||
local _inside = (dayz_inside || (DZE_roofOverhead && {DZE_sheltered > 0.96}));
|
||||
local _inSafeZone = false;
|
||||
|
||||
{
|
||||
if (player distance (_x select 0) < (_x select 1)) exitWith {_inSafeZone = true;};
|
||||
} count DZE_SafeZonePosArray;
|
||||
|
||||
if (player == _vehicle) then {
|
||||
if (_hasAPSI || {DZE_EVRProtectInside && _inside}) then {
|
||||
if (_hasAPSI || {DZE_EVRProtectInside && _inside} || {(DZE_EVRSafezoneExempt && _inSafeZone)}) then {
|
||||
player switchMove "";
|
||||
[objNull, player, rswitchMove, ""] call RE;
|
||||
} else {
|
||||
@@ -405,7 +410,7 @@ fnc_evr = {
|
||||
player action ["engineOff",_vehicle];
|
||||
_vehicle setFuel _fuel;
|
||||
} else {
|
||||
if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)}) then {
|
||||
if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)} && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
|
||||
player action ["eject",_vehicle];
|
||||
[] spawn {
|
||||
uiSleep 3;
|
||||
@@ -421,7 +426,7 @@ fnc_evr = {
|
||||
uiSleep 0.1;
|
||||
titleText["","BLACK OUT",1];
|
||||
|
||||
if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)}) then {
|
||||
if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)} && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
|
||||
r_player_inpain = true;
|
||||
player setVariable["USEC_inPain",true,true];
|
||||
local _blood = r_player_blood - ((DZE_EVRBloodLoss select 0) max random(DZE_EVRBloodLoss select 1)); // Player is not inside a building so reduce blood.
|
||||
@@ -440,7 +445,7 @@ fnc_evr = {
|
||||
titleText["","BLACK IN",10];
|
||||
ppEffectDestroy _effect;
|
||||
|
||||
if (DZE_EVRDamageItemsChance > 0) then {
|
||||
if (DZE_EVRDamageItemsChance > 0 && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
|
||||
local _items = [];
|
||||
{
|
||||
local _tool = _x select 0;
|
||||
@@ -462,7 +467,7 @@ fnc_evr = {
|
||||
"dynamicBlur" ppEffectCommit 16;
|
||||
|
||||
if (!_hasAPSI) then {
|
||||
if (player == vehicle player && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)}) then {
|
||||
if (player == vehicle player && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)} && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
|
||||
uiSleep 10; // 10 second knockout.
|
||||
[nil, player, rSWITCHMOVE, "AmovPpneMstpSnonWnonDnon_healed"] call RE;
|
||||
player SWITCHMOVE "AmovPpneMstpSnonWnonDnon_healed";
|
||||
|
||||
Reference in New Issue
Block a user