Always eject player when vehicle explodes

If the player is in a safezone we still want to eject them, just not
kill them.
This commit is contained in:
ebaydayz
2016-05-20 19:54:26 -04:00
parent 75e3ee58c2
commit 9dafa9d657
2 changed files with 4 additions and 3 deletions

View File

@@ -44,7 +44,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]];
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]];
DZE_GemOccurance = [["ItemTopaz",10], ["ItemObsidian",8], ["ItemSapphire",6], ["ItemAmethyst",4], ["ItemEmerald",3], ["ItemCitrine",2], ["ItemRuby",1]]; //Sets how rare each gem is in the order shown when mining (whole numbers only)
DZE_GodModeBaseExclude = []; //Array of object class names excluded from the god mode bases feature
DZE_buildMaxMoveDistance = 10; // Max distance player can walk from start position when building. Anything >= the differnce between DZE_PlotPole values is not recommended (allows walking into other plots).

View File

@@ -1,14 +1,15 @@
private ["_v","_int","_t","_b"];
private ["_v","_int","_t","_b","_KillEject"];
_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 ["Eject",vehicle player]; //eject player so their gear is accessible if dead and they aren't stuck in wreck if alive
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;
};