Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- span class="re5"> BTC_lift_pilot = [];
- BTC_lift = 1;
- BTC_lifted = 0;
- BTC_lift_min_h = 0;
- BTC_lift_max_h = 40;
- BTC_lift_radius = 5;
- BTC_Liftable = ["Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC","Air"];
- BTC_Hud_Cond = false;
- BTC_HUD_x = (SafeZoneW+2*SafeZoneX) + 0.045;
- BTC_HUD_y = (SafeZoneH+2*SafeZoneY) + 0.045;
- [] execVM "scripts\=BTC=_Logistic\lift\liftInit.sqf";
- //Functions
- BTC_get_liftable_array =
- {
- private ["_array","_chopper"];
- _chopper = _this select 0;
- _array = [];
- _choppType = typeOf _chopper;
- _onlyMoto = ["AH6X_DZ","MH6J_DZ"];
- _onlyMotoNCars = ["Ka52","Ka52Black","Ka60_GL","Ka60_GL_PMC","AH1Z","AH64D","Mi24","Mi24_V","Mi24_D"];
- _onlyMotoNCarsNShips = ["UH1H_DZE","UH1H_DZ","UH1Y_DZE","UH1Y_DZ","MH60S_DZE","UH60M_EP1_DZE","UH60M_EP1_DZ","UH60M_MEV_EP1","AW_159_Lynx_BAF"];
- _onlyLandVehNShips = ["Mi17_Civilian_DZ","Mi17_DZ","Mi17_DZE","Mi17_medevac_RU"];
- _allVehTypes = ["BAF_Merlin_DZE","BAF_Merlin_HC3_D","CH_47F_EP1_DZ","CH_47F_EP1_DZE","USEC_ch53_E","MV22_DZ"];
- _onlyAir = ["TowingTractor"];
- _array = call {
- if (_choppType in _onlyMoto) exitWith { ["Motorcycle"] };
- if (_choppType in _onlyMotoNCars) exitWith { ["Motorcycle","Car"] };
- if (_choppType in _onlyMotoNCarsNShips ) exitWith { ["Motorcycle","Car","Ship"] };
- if (_choppType in _onlyLandVehNShips) exitWith { ["LandVehicle","Ship"] };
- if (_choppType in _allVehTypes) exitWith { ["LandVehicle","Truck","Wheeled_APC","Tracked_APC","Air","Ship"] };
- ["Motorcycle","Car"]
- };
- _array
- };
- BTC_paradrop =
- {
- private ["_chopper","_cargo","_chute_type","_height","_smoke","_chute"];
- _chopper = _this select 0;
- _cargo = _this select 1;
- _chute_type = _this select 2;
- _chute = 0;
- _height = [_chopper, _cargo] call BTC_getHeight;
- diag_log format ["DEBUG BTC LIFT: Paradrop height: %1", _height];
- if (_height > 50) then {
- _chute = if (typeOf _chopper == "MH6J_DZ") then {
- createVehicle [_chute_type, [((position _chopper) select 0) - 5,((position _chopper) select 1) - 10,((position _chopper) select 2)- 4], [], 0, "NONE"];
- } else {
- createVehicle [_chute_type, [((position _chopper) select 0) - 5,((position _chopper) select 1) - 3,((position _chopper) select 2)- 4], [], 0, "NONE"];
- };
- _smoke = "SmokeshellGreen" createVehicle position _chopper;
- _smoke attachto [_cargo, [0,0,0]];
- _cargo attachTo [_chute, [0,0,0]];
- while {_height > 20} do {
- uiSleep 0.1;
- _height = [_chopper, _cargo] call BTC_getHeight;
- };
- detach _cargo;
- };
- };
- BTC_getHeight = {
- private ["_height","_chopper","_cargo","_cargo_position","_cargo_position_asl","_objects"];
- _chopper = _this select 0;
- _cargo = _this select 1;
- _cargo_position = getPosATL(_cargo);
- _cargo_position_asl = getPosASL(_cargo);
- //diag_log format ["DEBUG BTC LIFT: Get Cargo Pos: %1", _cargo_position];
- //diag_log format ["DEBUG BTC LIFT: Get Cargo Pos ASL: %1", _cargo_position_asl];
- _height = 0;
- //diag_log ("DEBUG BTC LIFT: Getting Objects");
- _objects = lineIntersectsWith [_cargo_position_asl, [(_cargo_position_asl select 0), (_cargo_position_asl select 1), -2000], _chopper, _cargo, true];
- //diag_log format ["DEBUG BTC LIFT: Objects: %1", _objects];
- if ((count _objects) > 0) then {
- //diag_log ("DEBUG BTC LIFT: Object count check true");
- _height = _cargo distance (_objects select 0);
- } else {
- //diag_log ("DEBUG BTC LIFT: Object count check false");
- _height = _cargo_position select 2;
- };
- //diag_log format ["DEBUG BTC LIFT: Pre _height: %1", _height];
- _height
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement