RamireDu06

Untitled

Oct 5th, 2020 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. create_bomber_func = {
  2. _pos_to_bomb = _this select 0;
  3.  
  4. _pos_where_plane_spawn = [_pos_to_bomb, 3500, 4000, 0, 1, 0, 0] call BIS_fnc_findSafePos;
  5. _good_pos_ps = [_pos_where_plane_spawn select 0, _pos_where_plane_spawn select 1, 800 + (_pos_to_bomb select 2)];
  6.  
  7. _bomber_plane = createVehicle ["LIB_Ju87", _good_pos_ps, [], 0, "FLY"];
  8. _bomber_plane setPosASL _good_pos_ps;
  9. _bomber_plane setDir ([_bomber_plane, _pos_to_bomb] call get_orientation2);
  10.  
  11. createVehicleCrew _bomber_plane;
  12.  
  13. _bomber_group = createGroup [west, true];
  14.  
  15. (crew _bomber_plane) joinSilent _bomber_group;
  16.  
  17. _bomber_group setCombatMode "BLUE";
  18. _bomber_group setBehaviour "CARELESS";
  19.  
  20. _pos_x_bp = _pos_to_bomb select 0;
  21. _pos_y_bp = _pos_to_bomb select 1;
  22. _pos_z_bp = _pos_to_bomb select 2;
  23.  
  24. _distance_calculated = (_pos_to_bomb distance2D _pos_where_plane_spawn);
  25.  
  26. _bomber_plane flyInHeight 0;
  27. _bomber_plane flyInHeightASL [800 + (_pos_to_bomb select 2),800 + (_pos_to_bomb select 2),800 + (_pos_to_bomb select 2)];
  28.  
  29. _bomber_plane limitSpeed 350;
  30.  
  31. _all_wp_pos = [];
  32.  
  33. _last_wp_multiplier = 0;
  34.  
  35. for "_compteur" from 0 to _distance_calculated step (_distance_calculated / 5) do {
  36. _cos_x_plr = ((cos ([_pos_to_bomb, _pos_where_plane_spawn] call get_orientation)) * _compteur) + _pos_x_bp;
  37. _sin_y_plr = ((sin ([_pos_to_bomb, _pos_where_plane_spawn] call get_orientation)) * _compteur) + _pos_y_bp;
  38.  
  39. _all_wp_pos pushBack [_cos_x_plr, _sin_y_plr];
  40. };
  41.  
  42. //reverse _all_wp_pos;
  43.  
  44. _small_calc = (_distance_calculated / 5);
  45. _last_wp_multiplier = (_last_wp_multiplier - (_small_calc * 1));
  46.  
  47. _cos_x_plr = ((cos ([_pos_to_bomb, _pos_where_plane_spawn] call get_orientation)) * _last_wp_multiplier) + _pos_x_bp;
  48. _sin_y_plr = ((sin ([_pos_to_bomb, _pos_where_plane_spawn] call get_orientation)) * _last_wp_multiplier) + _pos_y_bp;
  49.  
  50.  
  51. {
  52. _wp_pos = _x;
  53.  
  54. _wp1 = _bomber_group addWaypoint [AGLToASL([_wp_pos select 0, _wp_pos select 1, 0]), -1, 0];
  55. _wp1 setWaypointPosition [AGLToASL([_wp_pos select 0, _wp_pos select 1, 0]), -1];
  56.  
  57. _wp1 setWaypointType "MOVE";
  58. }forEach _all_wp_pos;
  59.  
  60.  
  61. _wp2 = _bomber_group addWaypoint [AGLToASL([_cos_x_plr, _sin_y_plr, 0]), -1, 0];
  62. _wp2 setWaypointPosition [AGLToASL([_cos_x_plr, _sin_y_plr, 0]), -1];
  63. _wp2 setWaypointType "MOVE";
  64.  
  65. _bomber_plane;
  66. };
Add Comment
Please, Sign In to add comment