normalKappa1.sqf 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. comment "Variable Decs";
  2. _this allowDamage false;
  3. _this setvariable ["Speed",200,true];
  4. _this setvariable ["turnon",true,true];
  5. comment "Increment Speed";
  6. _this addAction ["<t color='#A668C2'>Increment Speed by 10 -------- U16</t>",
  7. {
  8. (_this select 0) setvariable ["Speed",(((_this select 0) getVariable "Speed")+10),true];
  9. hint parseText format["<t color='#A668C2'> Speed set to:%1 Kmph</t>",((_this select 0) getVariable "Speed")];
  10. },[1],0,false,true,"User16"," driver _target == _this"];
  11. comment "Decrement Speed";
  12. _this addAction ["<t color='#FF69B4'>Decrement Speed by 10 -------- U17</t>",
  13. {
  14. (_this select 0) setvariable ["Speed",(((_this select 0) getVariable "Speed")-10),true];
  15. hint parseText format["<t color='#FF69B4'>Speed set to:%1 Kmph</t>",((_this select 0) getVariable "Speed")];
  16. },[1],0,false,true,"User17"," driver _target == _this"];
  17. comment "Engage";
  18. _this addAction ["<t color='#00FF00'>Engage C.R.U.I.S.I.E Control System -------- U18</t>",
  19. {
  20. (_this select 0) setobjecttextureglobal [1,"optre_vehicles\pelican\data\PelicanExterior_Black_CO.paa"];
  21. (_this select 0) setvariable ["turnon",true,true];
  22. hint parseText "<t color='#00FF00'>ENGAGING C.R.U.I.S.I.E Control System</t>";
  23. while { (alive (_this select 0)) AND (((_this select 0) getvariable "turnon"))} do
  24. {
  25. _Multiplier = 0.4;
  26. _Acceleration = 0.6;
  27. _sleep_time_acceleration_loop = 0.1;
  28. _Max_Multiplier = .1;
  29. _Coef_mul=((_Acceleration*_Multiplier/2)*(15*_sleep_time_acceleration_loop));
  30. if ((speed (_this select 0)) < ((_this select 0) getVariable "Speed")) then {
  31. ((_this select 0)) setVelocity
  32. [
  33. (velocity ((_this select 0)) select 0)+((vectordir ((_this select 0))) select 0)*_Coef_mul,
  34. (velocity ((_this select 0)) select 1)+((vectordir ((_this select 0))) select 1)*_Coef_mul,
  35. (velocity ((_this select 0)) select 2)+((vectordir ((_this select 0))) select 2)*_Coef_mul
  36. ]
  37. };
  38. if ((speed (_this select 0)) > ((_this select 0) getVariable "Speed")) then {
  39. _Coef_mul=-1*_Coef_mul;
  40. ((_this select 0)) setVelocity
  41. [
  42. (velocity ((_this select 0)) select 0)+((vectordir ((_this select 0))) select 0)*_Coef_mul,
  43. (velocity ((_this select 0)) select 1)+((vectordir ((_this select 0))) select 1)*_Coef_mul,
  44. (velocity ((_this select 0)) select 2)+((vectordir ((_this select 0))) select 2)*_Coef_mul
  45. ]
  46. };
  47. if (_Multiplier < _Max_Multiplier) then {_Multiplier = _Multiplier + 0.1*(15*_sleep_time_acceleration_loop)};
  48. };
  49. turnon=false;
  50. },[1],0,false,true,"User18"," driver _target == _this"];
  51. comment "Disenage";
  52. _this addAction ["<t color='#FFA500'>Disengage C.R.U.I.S.I.E Control System -------- U19</t>",
  53. {
  54. (_this select 0) setvariable ["turnon",false,true];
  55. hint parseText "<t color='#FFA500'>DISENGAGING C.R.U.I.S.I.E Control System</t>";
  56. hint parseText "<t color='#FFA500'>DRIVE DOWN</t>";
  57. },[1],0,false,true,"User19"," driver _target == _this"];
  58. comment "Halt";
  59. _this addAction ["<t color='#FF0000'>Stop Driver -------- U20</t>",
  60. {
  61. (_this select 0) setvariable ["turnon",false,true];
  62. hint parseText "<t color='#FF0000'>HALTING</t>";
  63. while {(speed (_this select 0) > 10)} do
  64. {
  65. hint "DRIVING DOWN NOW";
  66. _vel = velocity (_this select 0) ;
  67. _dir = direction (_this select 0) ;
  68. _speed = -3;
  69. (_this select 0) setVelocity [
  70. (_vel select 0) + (sin _dir * _speed),
  71. (_vel select 1) + (cos _dir * _speed),
  72. (_vel select 2)
  73. ];
  74. };
  75. hint parseText "<t color='#FF0000'>HALTING</t>";
  76. },[1],0,false,true,"User20"," driver _target == _this"];