Advertisement
GTA5HelpDesk

LemonUI Basic Code Part 2

Mar 3rd, 2023
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. using GTA;
  2. using LemonUI.Menus;
  3. using System;
  4. using System.Windows.Forms;
  5. using GTA.Native;
  6. using GTA.Math;
  7.  
  8. namespace LemonUI.Menu1
  9. {
  10. public class Basics : Script
  11. {
  12. public static Ped PP = Game.Player.Character;
  13.  
  14. private static readonly ObjectPool pool = new ObjectPool();
  15. private static readonly NativeMenu menu = new NativeMenu("Name of your Menu", " ", " ");
  16. private static readonly NativeItem SpawnSportster = new NativeItem("Spawn HD Sportster", "");
  17.  
  18. public Basics()
  19. {
  20. pool.Add(menu);
  21. menu.Add(SpawnSportster); SpawnSportster.Activated += VHDIron883;
  22.  
  23.  
  24.  
  25. Tick += Basics_Tick;
  26. KeyDown += Basics_KeyDown;
  27. }
  28.  
  29. private void Basics_Tick(object sender, EventArgs e)
  30. {
  31. pool.Process();
  32. }
  33.  
  34. private void Basics_KeyDown(object sender, KeyEventArgs e)
  35. {
  36. if (e.KeyCode == Keys.F3)
  37. { menu.Visible = true; }
  38.  
  39. }
  40.  
  41. private void VHDIron883(object sender, EventArgs e)
  42. {
  43. {
  44. //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
  45. Vehicle vehicle15 = World.CreateVehicle("HDIron883", PP.GetOffsetPosition(new Vector3(2, 0, 0)), PP.Heading + 90); //requires GTA.Math and GTA.Native
  46. Function.Call(Hash.SET_VEHICLE_COLOURS, vehicle15, 39, 39);
  47. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 1, 1); //remove all extras
  48. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 2, 1);
  49. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 3, 1);
  50. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 4, 1);
  51. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 5, 1);
  52. Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 6, 1);
  53. menu.Visible = false;
  54. }
  55. }
  56.  
  57.  
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement