boost_stop.sqf 1008 B

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