normalKappa1.sqf 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. comment "Varialbe 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</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</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</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 { ((_this select 0)) setVelocity [(velocity ((_this select 0)) select 0)+((vectordir ((_this select 0))) select 0)*_Coef_mul,(velocity ((_this select 0)) select 1)+((vectordir ((_this select 0))) select 1)*_Coef_mul,(velocity ((_this select 0)) select 2)+((vectordir ((_this select 0))) select 2)*_Coef_mul]};
  31. if (_Multiplier < _Max_Multiplier) then {_Multiplier = _Multiplier + 0.1*(15*_sleep_time_acceleration_loop)};
  32. };
  33. turnon=false;
  34. },[1],0,false,true,"User18"," driver _target == _this"];
  35. comment "Disenage";
  36. _this addAction ["<t color='#FFA500'>Disengage C.R.U.I.S.I.E Control System</t>",
  37. {
  38. (_this select 0) setvariable ["turnon",false,true];
  39. hint parseText "<t color='#FFA500'>DISENGAGING C.R.U.I.S.I.E Control System</t>";
  40. hint parseText "<t color='#FFA500'>DRIVE DOWN</t>";
  41. },[1],0,false,true,"User19"," driver _target == _this"];
  42. comment "Halt";
  43. _this addAction ["<t color='#FF0000'>Stop Driver</t>",
  44. {
  45. (_this select 0) setvariable ["turnon",false,true];
  46. hint parseText "<t color='#FF0000'>HALTING</t>";
  47. while {(speed (_this select 0) > 10)} do
  48. {
  49. hint "DRIVING DOWN NOW";
  50. _vel = velocity (_this select 0) ;
  51. _dir = direction (_this select 0) ;
  52. _speed = -3;
  53. (_this select 0) setVelocity [
  54. (_vel select 0) + (sin _dir * _speed),
  55. (_vel select 1) + (cos _dir * _speed),
  56. (_vel select 2)
  57. ];
  58. };
  59. hint parseText "<t color='#FF0000'>HALTING</t>";
  60. },[1],0,false,true,"User20"," driver _target == _this"];