mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 01:30:26 +03:00
Safezone whitelist for eject/destruction fixes
This commit prevents players who destroy their vehicle in god-mode safezones to be spared by the fixes in #2411973 and #ec7351d Configurable variable for this change is DZE_SafeZonePosArray = []; Update suggestion to use the stable branch of A2 OA in the changelog
This commit is contained in:
@@ -42,7 +42,7 @@ DZE_UI = "vanilla"; //"vanilla","epoch","dark" UI status icons style. Dark acco
|
||||
MaxAmmoBoxes = 3; // Max number of random Supply_Crate_DZE to spawn around the map
|
||||
MaxMineVeins = 50; // Max number of random mine veins to spawn around the map
|
||||
timezoneswitch = 0; // Changes murderMenu times with this offset in hours.
|
||||
|
||||
DZE_SafeZonePosArray = []; //Prevent players in safeZones from being killed if their vehicle is destroyed. Format is [[[3D POS] RADIUS],[[3D POS] RADIUS]]; Ex. DZE_SafeZonePosArray = [[[6325.6772,7807.7412,0],150],[[4063.4226,11664.19,0],150]];
|
||||
/*
|
||||
Developers:
|
||||
|
||||
|
||||
@@ -7,9 +7,17 @@ _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;
|
||||
_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;
|
||||
|
||||
@@ -67,8 +67,16 @@ while {(alive _vehicle)} do {
|
||||
if(player in (crew _vehicle)) then {sleep _wait;} else {sleep (_wait * 4);};
|
||||
};
|
||||
if (player in (crew _vehicle) && (!alive _vehicle)) 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; //kill player
|
||||
_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;
|
||||
};
|
||||
};
|
||||
_vehicle removeAllEventHandlers "Dammaged";
|
||||
Reference in New Issue
Block a user