boost_start.sqf 983 B

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