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

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