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:
icomrade
2016-04-27 00:17:54 -04:00
parent f102240821
commit 0e0a1e340f
4 changed files with 25 additions and 8 deletions

View File

@@ -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;

View File

@@ -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";