Use better method to find player's vehicle in Advanced Trading #1725

This commit is contained in:
ebaydayz
2016-08-05 13:43:58 -04:00
parent f6e10dd71c
commit c51fd11511
5 changed files with 95 additions and 66 deletions

View File

@@ -4,11 +4,11 @@ Z_vehicle = objNull;
_vehicle = objNull;
_pos = [player] call FNC_GetPos;
_list = nearestObjects [_pos, ["Air","LandVehicle","Ship"], Z_VehicleDistance];
{
if (!isNull _x && local _x && alive _x) then {
_vehicle = _x;
};
} count _list;
if (!isNull DZE_myVehicle && local DZE_myVehicle && alive DZE_myVehicle && DZE_myVehicle in _list) then {
_vehicle = DZE_myVehicle;
};
_result = false;
if (!isNull _vehicle) then {