Advertisement
Guest User

paradrop.sqf

a guest
Jul 15th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.66 KB | None | 0 0
  1. span class="re5"> fn_generateDrop = {
  2.    
  3.     params ["_plane"];
  4.    
  5.      private _boxType = "B_supplyCrate_F";
  6.      private _chuteType = "B_Parachute_02_F";
  7.      private _lightType = "chemlight_green";
  8.      private _smokeType = "smokeShellGreen";
  9.          
  10.      _chute = createVehicle [_chuteType, [0,0,0], [], 0, "NONE"];
  11.      _box = _boxType createVehicle (getposATL _chute);
  12.      _chute disableCollisionWith _plane;
  13.      _chute setpos getposATL _plane;
  14.          
  15.      _light = _lightType createVehicle getposATL _box;
  16.      _smoke = _smokeType createVehicle getposATL _box;
  17.      
  18.      _box attachto [_chute,[0,0,0]];
  19.      _light attachto [_box,[0,0,2]];
  20.      _smoke attachto [_box,[0,0,2]];
  21.    
  22.     waituntil {sleep 1; getposATL _box select 2 < 3};
  23.    
  24.     sleep 2;
  25.    
  26.     detach _box;
  27.  
  28. };
  29.  
  30. _start = _debugPoints select 0;
  31. _target = _debugPoints select 1;
  32.  
  33.  
  34. _plane = createVehicle ["RHS_C130J", [_start select 0,_start select 1,100], [], 0, "FLY"];
  35. _plane setposATL [getpos _plane select 0, getpos _plane select 1, 300];
  36.  
  37. _plane setdir (_plane getreldir _target);
  38. _heading = getdir _plane;
  39. _height = _plane flyinheight 300;
  40. _speed = 150;  
  41. _velx = (sin _heading * _speed);
  42. _vely = (cos _heading * _speed);
  43.  
  44. _plane setvelocity [_velx, _vely, 0];
  45. createVehicleCrew _plane;
  46.  
  47. _wp = group _plane addWaypoint [_target, 0];
  48. _wp setWaypointType "MOVE";
  49. _wp setwayPointSpeed "LIMITED";
  50.  
  51. waitUntil {sleep 1; getpos _plane distance2d _target < 300};
  52.  
  53. hint 'drop';
  54.  
  55. [_plane] spawn fn_generateDrop;
  56.  
  57. _wp = group _plane addWaypoint [[0,0,0], 0];
  58. _wp setWaypointType "MOVE";
  59. _wp setwayPointSpeed "LIMITED";
  60.  
  61. waitUntil {sleep 1; getposATL _plane distance2d _target > 2000};
  62.  
  63. deletevehicle _plane;
  64.  
  65. hint 'complete';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement