boostStop.sqf 843 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. try
  2. {
  3. params["_vic","_namMinSpeed","_namDeAccel"];
  4. hint format["DISENGAGING FORWARD THRUSTERS\n\nACTIVATING AIR BRAKES"];
  5. while {(!(_vic getvariable ["OPTRE_Thruster_EngagedStatus",false]) AND (speed _vic > _namMinSpeed))} do
  6. {
  7. _vel = velocity _vic;
  8. _dir = direction _vic;
  9. _speed = _namDeAccel;//-10
  10. /*optre boost logic
  11. _vic setVelocity [
  12. (_vel select 0) + (sin _dir * _speed),
  13. (_vel select 1) + (cos _dir * _speed),
  14. (_vel select 2)
  15. ];
  16. */
  17. //f-18 blakc mega hornet boost logic in reverse
  18. (_vic) setVelocity
  19. [
  20. (velocity (_vic) select 0)+((vectordir (_vic)) select 0)*-1*_speed,
  21. (velocity (_vic) select 1)+((vectordir (_vic)) select 1)*-1*_speed,
  22. (velocity (_vic) select 2)+((vectordir (_vic)) select 2)*-1*_speed
  23. ];
  24. sleep 0.5;
  25. };
  26. }
  27. catch
  28. {
  29. hint "wrong parameters passed";
  30. };