ashishcw

Indicator Script for GTA V Scripthook

Oct 7th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. using GTA;
  2. using GTA.Math;
  3. using GTA.Native;
  4. using NativeUI;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Drawing;
  8. using System.Linq.Expressions;
  9. using System.Windows.Forms;
  10. using System.Linq;
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. public class indicatorscript : Script
  18. { Ped PlayerPed;
  19. Vehicle vehicle;
  20.  
  21. string Scriptname = "Indicator Script";
  22. string ScriptVersion = " 1.0 ";
  23. string ScriptAuthor = "YCSM aka ashishcw for Yeahhmonkey";
  24.  
  25. bool isleftindicatoron = false;
  26. bool isrightindicatoron = false;
  27. bool arebothindicatoron = false;
  28.  
  29. Keys Modactive;
  30. Keys leftindicator;
  31. Keys rightindicator;
  32.  
  33.  
  34. public indicatorscript()
  35. {
  36.  
  37.  
  38. {
  39. Tick += onTick;
  40. KeyUp += onKeyUp;
  41. PlayerPed = Game.Player.Character;
  42. UI.Notify(Scriptname + ScriptVersion + "by " + ScriptAuthor);
  43.  
  44. //LoadSettings();
  45.  
  46. }
  47.  
  48. }
  49.  
  50. void onTick(Object sender, EventArgs e)
  51. {
  52. isleftindicatoron = true;
  53. isleftindicatoron = true;
  54. arebothindicatoron = true;
  55.  
  56. }
  57.  
  58.  
  59.  
  60. void LoadSettings()
  61. {
  62. if (isrightindicatoron == false)
  63. {
  64. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, false);
  65. }
  66. if (isrightindicatoron == false)
  67. {
  68. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 0, false);
  69. }
  70. if (arebothindicatoron == false)
  71. {
  72. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, 0, false);
  73. }
  74.  
  75. }
  76.  
  77. public void onKeyUp(object sender, KeyEventArgs e)
  78. {
  79. if(e.KeyCode == Keys.T)
  80. {
  81. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 0, false);
  82. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, true);
  83.  
  84. Wait(5000);
  85. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, false);
  86. //isleftindicatoron = false;
  87. }
  88.  
  89. if (e.KeyCode == Keys.Y)
  90. {
  91. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, false);
  92. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 0, true);
  93.  
  94. Wait(5000);
  95. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 0, false);
  96. //isrightindicatoron = false;
  97.  
  98. }
  99.  
  100. if (e.KeyCode == Keys.G)
  101. {
  102. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, true);
  103. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 0, true);
  104.  
  105. Wait(5000);
  106. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 1, false);
  107. Function.Call(Hash.SET_VEHICLE_INDICATOR_LIGHTS, PlayerPed.CurrentVehicle, 0, false);
  108. }
  109.  
  110.  
  111. }
  112. }
Add Comment
Please, Sign In to add comment