icdb

[ArmA3] Better CruiseMissile

Apr 11th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.81 KB | None | 0 0
  1. [(getPos player), (_this select 0)]  spawn {
  2.   private ["_posLaunch", "_target", "_path", "_pathS"];
  3.   _posLaunch = _this select 0;
  4.   _target = _this select 1;
  5.  
  6.   _path = "\rhsusf\addons\rhsusf_a2port_air2\CruiseMissile\";
  7.  _pathS = "\rhsusf\addons\rhsusf_c_a2port_air\scripts\missile\";
  8.  
  9.  private ["_misL", "_misFlare"];
  10.  _misL = "span class="re5"> CruiseMissile1" createVehicle [(_posLaunch select 0), (_posLaunch select 1), -1];
  11.  
  12.  _misFlare = "span class="re5"> CruiseMissileFlare1" createVehicle [(_posLaunch select 0), (_posLaunch select 1), -1];
  13.  _misFlare inflame true;
  14.  
  15.  _misL setVelocity [0, 0, 20];
  16.  [_misL] execVM (_pathS + "span class="re5"> watersplash.sqf");
  17.  
  18.  _misL setObjectTexture [0, "#(argb,8,8,3)color(0.501961,0.501961,0.501961,1.0,CO)"];
  19.   _misL setObjectTexture [1, "#(argb,8,8,3)color(0.501961,0.501961,0.501961,1.0,CO)"];
  20.   _misL setObjectTexture [2, "#(argb,8,8,3)color(0.501961,0.501961,0.501961,1.0,CO)"];
  21.   _misL setObjectTexture [3, "#(argb,8,8,3)color(0,0,0,1.0,co)"];
  22.  
  23.   _misL setVariable ["cruisemissile_level", false];
  24.  
  25.   sleep 0.8;
  26.  
  27.   [_misL, _misFlare] execVM (_pathS + "cruisemissileflare.sqf");
  28.   _misL setObjectTexture [4, _path + "data\exhaust_flame_ca"];
  29.   _misFlare say "CruiseMissileLaunch";
  30.   [_misL] execVM (_pathS + "exhaust1.sqf");
  31.   [_misL] execVM (_pathS + "exhaust3.sqf");
  32.  
  33.   sleep 0.3;
  34.  
  35.   [_misL] execVM (_pathS + "booster.sqf");
  36.   [_misl, "RHS_9M79_1_K",_posLaunch,_target] execVM (_pathS + "missile_control.sqf");
  37.  
  38.  
  39.   sleep 1;
  40.  
  41.   _misL setObjectTexture [0, ""];
  42.  
  43.   _misL animate ["Cover1", 1];
  44.   _misL animate ["Cover2", 1];
  45.   _misL animate ["Fin1", 1];
  46.   _misL animate ["Fin2", 1];
  47.   _misL animate ["Fin3", 1];
  48.   _misL animate ["Fin4", 1];
  49.   _misL animate ["Wing1", 1];
  50.   _misL animate ["Wing2", 1];
  51.   _misL animate ["Intake1", 1];
  52.  
  53.   sleep 0.5;
  54.  
  55.   _misL setObjectTexture [1, ""];
  56.   _misL setObjectTexture [2, ""];
  57.  
  58.   drop [_path + "cl_cover1", "", "SpaceObject", 1, 40, [-3, -3, -0.5], [-5, 0, 50], 2, 10.0, 1.0, 0, [1], [[1, 1, 1, 1]], [0, 1], 0, 0, "", "", _misL];
  59.   drop [_path + "cl_cover1", "", "SpaceObject", 1, 40, [3, 3, -0.5], [5, 0, 50], 2, 10.0, 1.0, 0, [1], [[1, 1, 1, 1]], [0, 1], 0, 0, "", "", _misL];
  60.  
  61.   waitUntil {getpos _misl select 2 > 10};
  62.  
  63.   _misL setVariable ["cruisemissile_level", true];
  64.  
  65.   _misL setObjectTexture [4, ""];
  66.  
  67.   private ["_pos", "_vel", "_dir"];
  68.   _pos = position _misL;
  69.   _vel = velocity _misL;
  70.   _dir = direction _misL;
  71.   deleteVehicle _misL;
  72.  
  73.   private ["_mis", "_pilot"];
  74.   _mis = "RHS_ammo_BGM109" createVehicle _pos;
  75.   _mis setDir ([_posLaunch, _target] call BIS_fnc_dirTo);
  76.   _mis setVelocity [0,0,20];
  77.  
  78.   drop [_path + "cl_booster1", "", "SpaceObject", 1, 40, [0, -5, 0], [0, 40, 0], 2, 3.0, 1.0, 0, [1], [[1, 1, 1, 1]], [0, 1], 0, 0, "", "", _mis];
  79.  
  80.   [_mis, "RHS_9M79_1_K",_posLaunch,_target] execVM (_pathS + "missile_control.sqf");
  81.  
  82.   true
  83. }
Advertisement
Add Comment
Please, Sign In to add comment