Guest User

Untitled

a guest
Jul 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using GTA;
  4.  
  5.  
  6.  
  7.  
  8.  
  9. public class FixaFlat : Script
  10. {
  11. Vehicle FlatTire = null;
  12. Keys FixFrontFlat;
  13. Keys FixRearFlat;
  14.  
  15. public FixaFlat()
  16. {
  17. Interval = 250;
  18. this.Tick += new EventHandler(this.FixaFlat_Tick);
  19. this.KeyDown += new GTA.KeyEventHandler(this.FixaFlat_KeyDown);
  20. FixFrontFlat = Settings.GetValueKey("InvisibleLadderKey", Keys.Z);
  21. FixRearFlat = Settings.GetValueKey("InvisibleLadderKey", Keys.X);
  22. }
  23.  
  24. private void Ladder_KeyDown(object sender, GTA.KeyEventArgs e)
  25. {
  26. if (e.Key == FixFrontFlat &&
  27. FlatTire != null && FlatTire.Exists() &&
  28. FlatTire.IsTireBurst(VehicleWheel.FrontLeft) ||
  29. FlatTire.IsTireBurst(VehicleWheel.FrontRight))
  30. {
  31. FlatTire.FixTire(VehicleWheel.FrontLeft);
  32. FlatTire.FixTire(VehicleWheel.FrontRight);
  33. }
  34. if (e.Key == FixRearFlat &&
  35. FlatTire != null && FlatTire.Exists() &&
  36. FlatTire.IsTireBurst(VehicleWheel.RearLeft) ||
  37. FlatTire.IsTireBurst(VehicleWheel.RearRight))
  38. {
  39. FlatTire.FixTire(VehicleWheel.RearLeft);
  40. FlatTire.FixTire(VehicleWheel.RearRight);
  41. }
  42. }
  43. private void FixaFlat_Tick(object sender, EventArgs e)
  44. {
  45. FlatTire = World.GetClosestVehicle(Player.Character.Position, 5.0F);
  46.  
  47. }
  48. }
Add Comment
Please, Sign In to add comment