Guest User

Untitled

a guest
Jul 10th, 2018
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. span class="re5"> BTC_lift_pilot   = [];
  2. BTC_lift         = 1;
  3. BTC_lifted       = 0;
  4. BTC_lift_min_h   = 0;
  5. BTC_lift_max_h   = 40;
  6. BTC_lift_radius  = 5;
  7. BTC_Liftable     = ["Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC","Air"];
  8. BTC_Hud_Cond     = false;
  9. BTC_HUD_x        = (SafeZoneW+2*SafeZoneX) + 0.045;
  10. BTC_HUD_y        = (SafeZoneH+2*SafeZoneY) + 0.045;
  11. [] execVM "scripts\=BTC=_Logistic\lift\liftInit.sqf";
  12.  
  13. //Functions
  14. BTC_get_liftable_array =
  15. {
  16.     private ["_array","_chopper"];
  17.     _chopper = _this select 0;
  18.     _array   = [];
  19.    
  20.     _choppType = typeOf _chopper;
  21.     _onlyMoto = ["AH6X_DZ","MH6J_DZ"];
  22.     _onlyMotoNCars = ["Ka52","Ka52Black","Ka60_GL","Ka60_GL_PMC","AH1Z","AH64D","Mi24","Mi24_V","Mi24_D"];
  23.     _onlyMotoNCarsNShips = ["UH1H_DZE","UH1H_DZ","UH1Y_DZE","UH1Y_DZ","MH60S_DZE","UH60M_EP1_DZE","UH60M_EP1_DZ","UH60M_MEV_EP1","AW_159_Lynx_BAF"];
  24.     _onlyLandVehNShips = ["Mi17_Civilian_DZ","Mi17_DZ","Mi17_DZE","Mi17_medevac_RU"];
  25.     _allVehTypes = ["BAF_Merlin_DZE","BAF_Merlin_HC3_D","CH_47F_EP1_DZ","CH_47F_EP1_DZE","USEC_ch53_E","MV22_DZ"];
  26.         _onlyAir = ["TowingTractor"];
  27.    
  28.     _array = call {
  29.         if (_choppType in _onlyMoto) exitWith { ["Motorcycle"] };
  30.         if (_choppType in _onlyMotoNCars) exitWith { ["Motorcycle","Car"] };
  31.         if (_choppType in _onlyMotoNCarsNShips ) exitWith { ["Motorcycle","Car","Ship"] };
  32.         if (_choppType in _onlyLandVehNShips) exitWith { ["LandVehicle","Ship"] };
  33.         if (_choppType in _allVehTypes) exitWith { ["LandVehicle","Truck","Wheeled_APC","Tracked_APC","Air","Ship"] };
  34.         ["Motorcycle","Car"]
  35.     };
  36.     _array
  37. };
  38.    
  39. BTC_paradrop =
  40. {
  41.     private ["_chopper","_cargo","_chute_type","_height","_smoke","_chute"];
  42.  
  43.     _chopper          = _this select 0;
  44.     _cargo      = _this select 1;
  45.     _chute_type   = _this select 2;
  46.     _chute = 0;
  47.    
  48.     _height = [_chopper, _cargo] call BTC_getHeight;
  49.    
  50.     diag_log format ["DEBUG BTC LIFT: Paradrop height: %1", _height];
  51.    
  52.     if (_height > 50) then {
  53.         _chute = if (typeOf _chopper == "MH6J_DZ") then {
  54.             createVehicle [_chute_type, [((position _chopper) select 0) - 5,((position _chopper) select 1) - 10,((position _chopper) select 2)- 4], [], 0, "NONE"];
  55.         } else {
  56.             createVehicle [_chute_type, [((position _chopper) select 0) - 5,((position _chopper) select 1) - 3,((position _chopper) select 2)- 4], [], 0, "NONE"];
  57.         };
  58.         _smoke        = "SmokeshellGreen" createVehicle position _chopper;
  59.         _smoke attachto [_cargo, [0,0,0]];
  60.         _cargo attachTo [_chute, [0,0,0]];
  61.         while {_height > 20} do {
  62.             uiSleep 0.1;
  63.             _height = [_chopper, _cargo] call BTC_getHeight;
  64.         };
  65.         detach _cargo;
  66.        
  67.     };
  68. };
  69.  
  70. BTC_getHeight = {
  71.     private ["_height","_chopper","_cargo","_cargo_position","_cargo_position_asl","_objects"];
  72.     _chopper = _this select 0;
  73.     _cargo = _this select 1;
  74.    
  75.     _cargo_position = getPosATL(_cargo);
  76.     _cargo_position_asl = getPosASL(_cargo);
  77.     //diag_log format ["DEBUG BTC LIFT: Get Cargo Pos: %1", _cargo_position];
  78.     //diag_log format ["DEBUG BTC LIFT: Get Cargo Pos ASL: %1", _cargo_position_asl];
  79.     _height = 0;
  80.  
  81.     //diag_log ("DEBUG BTC LIFT: Getting Objects");
  82.     _objects = lineIntersectsWith [_cargo_position_asl, [(_cargo_position_asl select 0), (_cargo_position_asl select 1), -2000], _chopper, _cargo, true];
  83.     //diag_log format ["DEBUG BTC LIFT: Objects: %1", _objects];
  84.     if ((count _objects) > 0) then {
  85.         //diag_log ("DEBUG BTC LIFT: Object count check true");
  86.         _height = _cargo distance (_objects select 0);
  87.     } else {
  88.         //diag_log ("DEBUG BTC LIFT: Object count check false");
  89.         _height = _cargo_position select 2;
  90.     };
  91.     //diag_log format ["DEBUG BTC LIFT: Pre _height: %1", _height];
  92.     _height
  93. };
RAW Paste Data