boostStart.sqf 917 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. try
  2. {
  3. params["_vic","_namMaxSpeed","_namMinSpeed","_namAccel"];
  4. hint "ENGAGING FORWARD THRUSTERS";
  5. if(speed _vic >= _namMinSpeed) then
  6. {
  7. while {((_pelican getvariable ["OPTRE_Thruster_EngagedStatus",false]) AND (alive _vic))} do
  8. {
  9. if (speed _vic <= 600) then {
  10. _vel = velocity _vic;
  11. _dir = direction _vic;
  12. _speed = _namAccel;//10
  13. /* optre boost logic
  14. _vic setVelocity [
  15. (_vel select 0) + (sin _dir * _speed),
  16. (_vel select 1) + (cos _dir * _speed),
  17. (_vel select 2)
  18. ];
  19. */
  20. //f-18 black super mega horent boost logic
  21. (_vic) setVelocity
  22. [
  23. (velocity (_vic) select 0)+((vectordir (_vic)) select 0)*_speed,
  24. (velocity (_vic) select 1)+((vectordir (_vic)) select 1)*_speed,
  25. (velocity (_vic) select 2)+((vectordir (_vic)) select 2)*_speed
  26. ];
  27. };
  28. sleep 0.5;
  29. };
  30. };
  31. }
  32. catch
  33. {
  34. hint "wrong parameters passed";
  35. };