GTA5HelpDesk

Untitled

Mar 3rd, 2023
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. // LemonUI Basic Code Part 4
  2. using GTA;
  3. using LemonUI.Menus;
  4. using System;
  5. using System.Windows.Forms;
  6. using GTA.Native;
  7. using GTA.Math;
  8.  
  9. namespace LemonUI.Menu1
  10. {
  11. public class Basics : Script
  12. {
  13. public static Ped PP = Game.Player.Character;
  14.  
  15. private static readonly ObjectPool pool = new ObjectPool();
  16. private static readonly NativeMenu menu = new NativeMenu("Name of your Menu", " ", " ");
  17. private static readonly NativeItem SpawnSportster = new NativeItem("Spawn HD Sportster", "");
  18.  
  19. private static readonly NativeMenu submenuCorvettes = new NativeMenu("Vettes", "~g~Chevrolet Corvettes", "");
  20. private static readonly NativeItem VetteSplitWindow = new NativeItem("1963 Corvette Split Window", "Really cool car");
  21. private static readonly NativeItem VetteZ06 = new NativeItem("2023 Corvette Z06", "Hot Performance");
  22.  
  23.  
  24. public Basics()
  25. {
  26. pool.Add(menu);
  27. menu.Add(SpawnSportster); SpawnSportster.Activated += VHDIron883;
  28.  
  29. menu.AddSubMenu(submenuCorvettes, "..."); pool.Add(submenuCorvettes);
  30. submenuCorvettes.MaxItems = 25;
  31. submenuCorvettes.Add(VetteSplitWindow); VetteSplitWindow.Activated += SpawnVetteSplitWindow;
  32. submenuCorvettes.Add(VetteZ06); VetteZ06.Activated += SpawnVetteZ06;
  33.  
  34.  
  35. Tick += Basics_Tick;
  36. KeyDown += Basics_KeyDown;
  37. }
  38.  
  39. private void Basics_Tick(object sender, EventArgs e)
  40. {
  41. pool.Process();
  42. }
  43.  
  44. private void Basics_KeyDown(object sender, KeyEventArgs e)
  45. {
  46. if (e.KeyCode == Keys.F3)
  47. { menu.Visible = true; }
  48.  
  49. }
  50.  
  51. private void VHDIron883(object sender, EventArgs e)
  52. {
  53.  
  54. //Vehicle vehicle15 = World.CreateVehicle("HDIron883", PP.Position + PP.ForwardVector * 3.0f, PP.Heading + 90); //Another way of doing it, doesn't require GTA.Math and GTA.Native
  55. Vehicle vehicle15 = World.CreateVehicle("HDIron883", PP.GetOffsetPosition(new Vector3(2, 0, 0)), PP.Heading + 90); //requires GTA.Math and GTA.Native
  56. Function.Call(Hash.SET_VEHICLE_COLOURS, vehicle15, 39, 39);
  57. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 1, 1); //remove all extras
  58. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 2, 1);
  59. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 3, 1);
  60. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 4, 1);
  61. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 5, 1);
  62. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 6, 1);
  63. menu.Visible = false;
  64.  
  65. }
  66. private void SpawnVetteSplitWindow(object sender, EventArgs e)
  67. { //your code here }
  68.  
  69. private void SpawnVetteZ06(object sender, EventArgs e)
  70. { //your code here }
  71.  
  72.  
  73.  
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment