Advertisement
Guest User

paradrop.sqf

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