Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 22.49 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. using GTA;
  6. using GTA.Math;
  7. using GTA.Native;
  8. using NativeUI;
  9. using System.Linq;
  10.  
  11. public class MenuExample: Script {
  12.  private MenuPool _menuPool;
  13.  private string addon_name = "";
  14.  private bool isAddons = false;
  15.  private int limiteGuardac = 7;
  16.  private Player player = Game.Player;
  17.  List < Ped > peds = new List < Ped > ();
  18.  float bla = 0.00 f;
  19.  int blas = 10;
  20.  private bool dSpeed = false;
  21.  private Ped playerPed = Game.Player.Character;
  22.  private Ped ped;
  23.  double cnt = 0;
  24.  bool marker = true;
  25.  bool mSet = false;
  26.  double cntMax = 1000000000;
  27.  double cnt_d = 1000000000 / 22;
  28.  double cnt_d2 = 1000000000 / 24;
  29.  List < string > names = new List < string > ();
  30.  float x = 1 f, y = 1 f, z = 1 f;
  31.  PedHash hash;
  32.  bool UsingGamepad = Function.Call < bool > (Hash._GET_LAST_INPUT_METHOD);
  33.  bool superJump = false, isAuto = false, bodyguardOn = false;
  34.  int driveTipe = 6, indax;
  35.  float autoSpeed = 25;
  36.  string carnome;
  37.  Vector3 v1 = new Vector3(25.8693 f, 540.4783 f, 175 f);
  38.  private bool checkbox = false;
  39.  Vector3 v2 = new Vector3(29.0000 f, 538.6783 f, 175 f);
  40.  Vector3 v3 = new Vector3(47.8523 f, -1912.992 f, 20.8000 f);
  41.  private Model characterModel;
  42.  
  43.  
  44.  void spawnPed(PedHash hashi, bool isAddon, string addonName) {
  45.   if (isAddon == true) {
  46.    peds.Add(World.CreatePed(addonName, playerPed.GetOffsetInWorldCoords(new Vector3(0, 5, 0))));
  47.   } else {
  48.    peds.Add(World.CreatePed(hashi, playerPed.GetOffsetInWorldCoords(new Vector3(0, 5, 0))));
  49.   }
  50.   int player_group = Function.Call < int > (Hash.GET_PLAYER_GROUP, player.Handle);
  51.   Function.Call(Hash.SET_PED_AS_GROUP_LEADER, playerPed, player_group);
  52.  
  53.  
  54.   Wait(100);
  55.   var pedx = peds.Last();
  56.   Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, pedx.Handle, player_group);
  57.   pedx.RelationshipGroup = playerPed.RelationshipGroup;
  58.   pedx.AddBlip();
  59.   pedx.CanBeTargetted = true;
  60.   pedx.Weapons.Give(WeaponHash.AssaultRifle, 99999, true, true);
  61.   pedx.Weapons.Give(WeaponHash.APPistol, 99999, true, true);
  62.   pedx.Accuracy = 100;
  63.   pedx.IsInvincible = true;
  64.   //pedx.Task.FightAgainstHatedTargets(50000);
  65.   pedx.AlwaysKeepTask = false;
  66.   pedx.StaysInVehicleWhenJacked = false;
  67.   pedx.StaysInVehicleWhenJacked = false;
  68.   pedx.CanBeDraggedOutOfVehicle = false;
  69.   pedx.Armor = 100;
  70.   pedx.IsPersistent = true;
  71.   Function.Call(Hash.SET_PED_INFINITE_AMMO, pedx, true, "" + WeaponHash.AssaultRifle);
  72.   Function.Call(Hash.SET_PED_INFINITE_AMMO, pedx, true, "" + WeaponHash.APPistol);
  73.   Function.Call(Hash.SET_PED_INFINITE_AMMO_CLIP, pedx, true);
  74.   pedx.CurrentBlip.Color = BlipColor.Blue;
  75.   pedx.CurrentBlip.Name = "Meu Tropa " + peds.IndexOf(peds.Last());
  76.   bodyguardOn = true;
  77.  
  78.   Wait(50);
  79.  
  80.  }
  81.  void spawnCar(string Carname) {
  82.   try {
  83.    if (playerPed.IsInVehicle()) {
  84.     float speed = playerPed.CurrentVehicle.Speed;
  85.     Game.Player.Character.CurrentVehicle.Delete();
  86.     Vehicle vehBanshee = World.CreateVehicle(Carname, playerPed.Position, playerPed.Heading + 10);
  87.     playerPed.Task.WarpIntoVehicle(vehBanshee, VehicleSeat.Driver);
  88.     if (vehBanshee.IsAlive) {
  89.      carnome = vehBanshee.DisplayName;
  90.      vehBanshee.EngineRunning = true;
  91.      vehBanshee.NumberPlate = "MaC 2745";
  92.      if (bodyguardOn == true) {
  93.       ped.Task.WarpIntoVehicle(vehBanshee, VehicleSeat.Any);
  94.      }
  95.      vehBanshee.Speed = speed;
  96.      vehBanshee.CanWheelsBreak = false;
  97.      vehBanshee.CanTiresBurst = false;
  98.      vehBanshee.IsBulletProof = true;
  99.      vehBanshee.IsPersistent = true;
  100.      vehBanshee.IsStolen = false;
  101.      vehBanshee.PlaceOnGround();
  102.      vehBanshee.ToggleMod(VehicleToggleMod.Turbo, true);
  103.      vehBanshee.ToggleMod(VehicleToggleMod.TireSmoke, true);
  104.      vehBanshee.ToggleMod(VehicleToggleMod.XenonHeadlights, true);
  105.      vehBanshee.InstallModKit();
  106.      vehBanshee.SetMod(VehicleMod.Engine, 3, true);
  107.      vehBanshee.SetMod(VehicleMod.Suspension, 3, true);
  108.      vehBanshee.SetMod(VehicleMod.Transmission, 2, true);
  109.      vehBanshee.SetMod(VehicleMod.Brakes, 2, true);
  110.      vehBanshee.SetMod(VehicleMod.Armor, 4, true);
  111.      vehBanshee.Repair();
  112.      vehBanshee.Wash();
  113.      UI.Notify("~g~Código Activado: \n~w~O seu veículo " + carnome + " foi entregue!");
  114.     }
  115.    } else {
  116.     Vehicle vehBanshee = World.CreateVehicle(Carname, playerPed.Position, playerPed.Heading + 10);
  117.     playerPed.Task.WarpIntoVehicle(vehBanshee, VehicleSeat.Driver);
  118.     if (vehBanshee.IsAlive) {
  119.      vehBanshee.NumberPlate = "MaC 2745";
  120.      vehBanshee.EngineRunning = true;
  121.      carnome = vehBanshee.DisplayName;
  122.      if (bodyguardOn == true) {
  123.       ped.Task.WarpIntoVehicle(vehBanshee, VehicleSeat.Any);
  124.      }
  125.      vehBanshee.CanWheelsBreak = false;
  126.      vehBanshee.CanTiresBurst = false;
  127.      vehBanshee.IsBulletProof = true;
  128.      vehBanshee.IsPersistent = true;
  129.      vehBanshee.IsStolen = false;
  130.      vehBanshee.PlaceOnGround();
  131.      vehBanshee.ToggleMod(VehicleToggleMod.Turbo, true);
  132.      vehBanshee.ToggleMod(VehicleToggleMod.TireSmoke, true);
  133.      vehBanshee.ToggleMod(VehicleToggleMod.XenonHeadlights, true);
  134.      vehBanshee.InstallModKit();
  135.      vehBanshee.SetMod(VehicleMod.Engine, 3, true);
  136.      vehBanshee.SetMod(VehicleMod.Suspension, 3, true);
  137.      vehBanshee.SetMod(VehicleMod.Transmission, 2, true);
  138.      vehBanshee.SetMod(VehicleMod.Brakes, 2, true);
  139.      vehBanshee.SetMod(VehicleMod.Armor, 4, true);
  140.      vehBanshee.Repair();
  141.      vehBanshee.Wash();
  142.      UI.Notify("~g~Código Activado: \n~w~O seu veículo " + carnome + " foi entregue!");
  143.     }
  144.    }
  145.   } catch {
  146.    UI.Notify("~r~ERROR: \n~w~Não foi possivel ler as HASH's de Veiculos!");
  147.   }
  148.  }
  149.  
  150.  // This is where Menu1 is created
  151.  public void Menu1(UIMenu menu) {
  152.   var newbutton1 = new UIMenuItem("Banshee", "Spawn vehicle next to you.");
  153.   var newbutton2 = new UIMenuItem("Futo", "Spawn vehicle next to you.");
  154.   var newbutton3 = new UIMenuItem("Honda Civic 8Th", "Spawn vehicle next to you.");
  155.   var newbutton4 = new UIMenuItem("Mitsubishi Eclipse", "Spawn vehicle next to you.");
  156.   var newbutton5 = new UIMenuItem("Teleport to Waypoint", "Teleport to Waypoint location.");
  157.   var newbutton6 = new UIMenuItem("Golf GTI MK4", "Spawn vehicle next to you.");
  158.   var newbutton7 = new UIMenuItem("Auto-Drive to Waypoint", "Auto-drive to waypoint location.");
  159.   var newbutton8 = new UIMenuItem("Kit'ar Carro MAX", "(Sem visuais / Só Motor,Turbo, Suspensão, Travões, Blindagem...)");
  160.   var newbutton9 = new UIMenuItem("Feltzer", "Spawn vehicle next to you.");
  161.   var newbutton10 = new UIMenuItem("Manchez (Mota)", "Spawn vehicle next to you.");
  162.   var newbutton11 = new UIMenuItem("Mazda Mx5 StanceCamber", "Spawn vehicle next to you.");
  163.   var newbutton12 = new UIMenuItem("Pedir Guarda-Costas", "Faça aparecer um guarda-costas para si.(Máximo = 1)");
  164.   var newbutton13 = new UIMenuItem("Apagar Guarda-Costas", "Elimine o seu guarda-costas atual.");
  165.   var newbutton14 = new UIMenuItem("BMW (Sentinel)", "Spawn vehicle next to you.");
  166.   var newbutton15 = new UIMenuItem("Honda Type-R (Praire)", "Spawn vehicle next to you.");
  167.   var newbutton16 = new UIMenuItem("Honda Civic SI'99", "w/ Tunning Mods");
  168.   var newbutton17 = new UIMenuItem("4x4 Street Blazer (Mota)", "w/ Tunning Mods");
  169.   var newbutton18 = new UIMenuItem("x80 PROTO", "w/ Tunning Mods");
  170.   var newbutton19 = new UIMenuItem("Subaru Impreza WRX", "w/ Tunning Mods");
  171.   var newbutton20 = new UIMenuItem("Honda S2000", "w/ Tunning Mods");
  172.   var newbutton21 = new UIMenuItem("Toyota Supra", "w/ Tunning Mods");
  173.   var newbutton22 = new UIMenuItem("Peugeot 206", "w/ Tunning Mods");
  174.   var newbutton23 = new UIMenuItem("Futo 2", "w/ Tunning Mods");
  175.   var newbutton24 = new UIMenuItem("BMW M3 E36", "w/ Tunning Mods");
  176.   var newbutton25 = new UIMenuItem("BMW E36 RB", "w/ Tunning Mods");
  177.   var newbutton26 = new UIMenuItem("Mercedes C63 AMG S", "w/ Tunning Mods");
  178.   var newbutton27 = new UIMenuItem("Golf V GTI", "w/ Tunning Mods");
  179.   var newbutton28 = new UIMenuItem("Nova 1996", "w/ Tunning Mods");
  180.   var newbutton29 = new UIMenuItem("Missões", "Clique em 'Installed Missions' e escolha uma missão.");
  181.   List < dynamic > listas = new List < dynamic > {
  182.    "Super-Homem",
  183.    "Eminem",
  184.    "Michael Scofield",
  185.    "2Pac",
  186.    "Hitman Agente 47",
  187.    "Will Smith MIB",
  188.    "John Wick",
  189.    "Mai Shiranui",
  190.    "James Bond 007",
  191.    "Gang(Families) Female",
  192.    "Gang(Families) Male 1",
  193.    "Gang(Families) Male 2",
  194.    "Gang(Families) Old Male",
  195.    "Gang(Prisioner) Male",
  196.    "Policia Female",
  197.    "Barman Male",
  198.    "Puta Female",
  199.    "DrugDealer Male",
  200.    "Exército Male",
  201.    "Exército Male 2",
  202.    "Agente FBI Male",
  203.    "Puta Topless Female",
  204.    "Macaco Assassino"
  205.  
  206.  
  207.   };
  208.   List < dynamic > modoDrive = new List < dynamic > {
  209.    "Evitar Transito",
  210.    "Normal",
  211.    "Agressivo"
  212.   };
  213.   List < dynamic > limiteGuardas = new List < dynamic > {
  214.    "1",
  215.    "2",
  216.    "3",
  217.    "4",
  218.    "5",
  219.    "6",
  220.    "7",
  221.    "8",
  222.    "Ilimitado (100)"
  223.   };
  224.   var lista = new UIMenuListItem("Escolher:", listas, 0);
  225.  
  226.   var listaDrive = new UIMenuListItem("AutoDrive:", modoDrive, 0);
  227.  
  228.   var sub1 = _menuPool.AddSubMenu(menu, "Spawn Carros");
  229.   menu.AddItem(newbutton8);
  230.   var sub2 = _menuPool.AddSubMenu(menu, "Player");
  231.   var sub4 = _menuPool.AddSubMenu(menu, "Guarda-Costas");
  232.   menu.AddItem(newbutton29);
  233.  
  234.   List < dynamic > listofweapons = new List < dynamic > ();
  235.   WeaponHash[] allweaponhashes = (WeaponHash[]) Enum.GetValues(typeof(WeaponHash));
  236.   for (int i = 0; i < allweaponhashes.Length; i++) {
  237.    listofweapons.Add(allweaponhashes[i]);
  238.   }
  239.   UIMenuListItem list = new UIMenuListItem("Armas:", listofweapons, 9);
  240.   //Submenu Carros
  241.   sub1.AddItem(newbutton16);
  242.   sub1.AddItem(newbutton4);
  243.   sub1.AddItem(newbutton14);
  244.   sub1.AddItem(newbutton1);
  245.   sub1.AddItem(newbutton2);
  246.   sub1.AddItem(newbutton3);
  247.   sub1.AddItem(newbutton6);
  248.   sub1.AddItem(newbutton9);
  249.   sub1.AddItem(newbutton10);
  250.   sub1.AddItem(newbutton17);
  251.   sub1.AddItem(newbutton11);
  252.   sub1.AddItem(newbutton18);
  253.   sub1.AddItem(newbutton15);
  254.   sub1.AddItem(newbutton19);
  255.   sub1.AddItem(newbutton20);
  256.   sub1.AddItem(newbutton21);
  257.   sub1.AddItem(newbutton22);
  258.   sub1.AddItem(newbutton23);
  259.   sub1.AddItem(newbutton24);
  260.   sub1.AddItem(newbutton25);
  261.   sub1.AddItem(newbutton26);
  262.   sub1.AddItem(newbutton27);
  263.   sub1.AddItem(newbutton28);
  264.   sub1.OnItemSelect += (sender, item, index) => {
  265.  
  266.    try {
  267.     String it = item.ToString();
  268.     String nb4 = newbutton4.ToString();
  269.  
  270.     if (item == newbutton4) {
  271.      spawnCar("" + VehicleHash.Ninef2);
  272.     }
  273.     if (item == newbutton1) {
  274.      spawnCar("" + VehicleHash.Banshee);
  275.     }
  276.     if (item == newbutton2) {
  277.      spawnCar("FUTO");
  278.     }
  279.     if (item == newbutton3) {
  280.      spawnCar("CIVIC8TH");
  281.     }
  282.     if (item == newbutton6) {
  283.      spawnCar("SULTANRS");
  284.     }
  285.     if (item == newbutton9) {
  286.      spawnCar("" + VehicleHash.Feltzer2);
  287.     }
  288.     if (item == newbutton10) {
  289.      spawnCar("Manchez");
  290.     }
  291.     if (item == newbutton11) {
  292.      spawnCar("mx5stance");
  293.     }
  294.     if (item == newbutton14) {
  295.      spawnCar("sentinel");
  296.     }
  297.     if (item == newbutton15) {
  298.      spawnCar("praire");
  299.     }
  300.     if (item == newbutton16) {
  301.      spawnCar("civic");
  302.     }
  303.     if (item == newbutton17) {
  304.      spawnCar("blazer4");
  305.     }
  306.     if (item == newbutton18) {
  307.      spawnCar("prototipo");
  308.     }
  309.     if (item == newbutton19) {
  310.      spawnCar("subwrx");
  311.     }
  312.     if (item == newbutton20) {
  313.      spawnCar("ap2");
  314.     }
  315.     if (item == newbutton21) {
  316.      spawnCar("supra2");
  317.     }
  318.     if (item == newbutton22) {
  319.      spawnCar("206");
  320.     }
  321.     if (item == newbutton23) {
  322.      spawnCar("futo2");
  323.     }
  324.     if (item == newbutton24) {
  325.      spawnCar("rmodm3e36");
  326.     }
  327.     if (item == newbutton25) {
  328.      spawnCar("e36rb");
  329.     }
  330.     if (item == newbutton26) {
  331.      spawnCar("c63w205");
  332.     }
  333.     if (item == newbutton27) {
  334.      spawnCar("golfgti");
  335.     }
  336.     if (item == newbutton28) {
  337.      spawnCar("nova");
  338.     }
  339.    } catch {
  340.     UI.Notify("~r~ERROR: \n~w~ HASH do veiculo nao Existe!");
  341.    }
  342.   };
  343.  
  344.   //Submenu Player
  345.   sub2.AddItem(newbutton5);
  346.  
  347.   sub2.AddItem(listaDrive);
  348.   sub2.OnItemSelect += (sender, item, index) => {
  349.  
  350.    if (item == listaDrive) {
  351.     int listaIndex = listaDrive.Index;
  352.     if (listaIndex == 0) {
  353.      driveTipe = 6;
  354.     }
  355.     if (listaIndex == 1) {
  356.      driveTipe = 786603;
  357.     }
  358.     if (listaIndex == 2) {
  359.      driveTipe = 1074528293;
  360.     }
  361.     if (playerPed.IsInVehicle() && isAuto == false && Game.IsWaypointActive == true) {
  362.      playerPed.Task.DriveTo(playerPed.CurrentVehicle, World.GetWaypointPosition(), 500, autoSpeed, driveTipe);
  363.      isAuto = true;
  364.     } else {
  365.      isAuto = false;
  366.      UI.Notify("~r~ERROR: \n~w~Não está num veiculo ou nao tem um waypoint definido!");
  367.     }
  368.    }
  369.  
  370.  
  371.    if (item == newbutton5) {
  372.     playerPed.PositionNoOffset = World.GetWaypointPosition();
  373.     Wait(500);
  374.    }
  375.   };
  376.   menu.OnItemSelect += (sender, item, index) => {
  377.    if (item == newbutton29) {
  378.     try {
  379.      SendKeys.SendWait("H");
  380.      menu.Visible = !menu.Visible;
  381.     } catch {
  382.      UI.Notify("ERRO! H");
  383.     }
  384.    }
  385.   };
  386.   var chk = new UIMenuCheckboxItem("SuperJump", checkbox, "Activate Super Jump!");
  387.   sub2.AddItem(chk);
  388.   var chk2 = new UIMenuCheckboxItem("SuperRun", checkbox, "Activate Super Run!");
  389.   sub2.AddItem(chk2);
  390.  
  391.   //menu guarda-costas
  392.   sub4.AddItem(lista);
  393.   sub4.AddItem(newbutton13);
  394.   sub4.OnItemSelect += (sender, item, index) => {
  395.    if (item == lista) // If statement
  396.    {
  397.     if (peds.Count < limiteGuardac) {
  398.      try {
  399.       int listIndex = lista.Index;
  400.       switch (listIndex) {
  401.        case 0:
  402.         hash = 0;
  403.         indax = 0;
  404.         isAddons = true;
  405.         addon_name = "superman";
  406.         break;
  407.        case 1:
  408.         hash = 0;
  409.         indax = 0;
  410.         isAddons = true;
  411.         addon_name = "eminem";
  412.         break;
  413.        case 2:
  414.         hash = 0;
  415.         indax = 0;
  416.         isAddons = true;
  417.         addon_name = "prisoner";
  418.         break;
  419.        case 3:
  420.         hash = 0;
  421.         indax = 0;
  422.         isAddons = true;
  423.         addon_name = "2pac";
  424.         break;
  425.        case 4:
  426.         hash = 0;
  427.         indax = 0;
  428.         isAddons = true;
  429.         addon_name = "chauve";
  430.         break;
  431.        case 5:
  432.         hash = 0;
  433.         indax = 0;
  434.         isAddons = true;
  435.         addon_name = "WillSmith";
  436.         break;
  437.        case 6:
  438.         hash = 0;
  439.         indax = 0;
  440.         isAddons = true;
  441.         addon_name = "wick";
  442.         break;
  443.  
  444.        case 7:
  445.         hash = 0;
  446.         indax = 0;
  447.         isAddons = true;
  448.         addon_name = "MaiCasual";
  449.         break;
  450.        case 8:
  451.         hash = 0;
  452.         indax = 0;
  453.         isAddons = true;
  454.         addon_name = "James Bond DC";
  455.         break;
  456.        case 9:
  457.         hash = PedHash.Families01GFY;
  458.         indax = 0;
  459.         isAddons = false;
  460.         break;
  461.        case 10:
  462.         hash = PedHash.Famca01GMY;
  463.         indax = 0;
  464.         isAddons = false;
  465.         break;
  466.        case 11:
  467.         hash = PedHash.Famdnf01GMY;
  468.         indax = 0;
  469.         isAddons = false;
  470.         break;
  471.        case 12:
  472.         hash = PedHash.AfriAmer01AMM;
  473.         indax = 0;
  474.         isAddons = false;
  475.         break;
  476.        case 13:
  477.         hash = PedHash.PrisMuscl01SMY;
  478.         indax = 0;
  479.         isAddons = false;
  480.         break;
  481.        case 14:
  482.         hash = PedHash.Cop01SFY;
  483.         indax = 0;
  484.         isAddons = false;
  485.         break;
  486.        case 15:
  487.         hash = PedHash.Barman01SMY;
  488.         indax = 0;
  489.         isAddons = false;
  490.         break;
  491.        case 16:
  492.         hash = PedHash.Juggalo01AFY;
  493.         isAddons = false;
  494.         indax = 0;
  495.         break;
  496.        case 17:
  497.         hash = PedHash.Dealer01SMY;
  498.         indax = 0;
  499.         isAddons = false;
  500.         break;
  501.        case 18:
  502.         hash = PedHash.Marine01SMY;
  503.         indax = 0;
  504.         isAddons = false;
  505.         break;
  506.        case 19:
  507.         hash = PedHash.Marine03SMY;
  508.         indax = 0;
  509.         isAddons = false;
  510.         break;
  511.        case 20:
  512.         hash = PedHash.FbiSuit01;
  513.         indax = 0;
  514.         isAddons = false;
  515.         break;
  516.        case 21:
  517.         hash = PedHash.Topless01AFY;
  518.         indax = 0;
  519.         isAddons = false;
  520.         break;
  521.        case 22:
  522.         hash = PedHash.Pogo01;
  523.         indax = 0;
  524.         isAddons = false;
  525.         break;
  526.  
  527.       }
  528.       spawnPed(hash, isAddons, addon_name);
  529.  
  530.      } catch {
  531.       UI.Notify("~r~ERROR: \n~w~Não foi possivel ler as HASH's dos Peds!");
  532.      }
  533.     } else {
  534.      UI.Notify("~r~ERROR: \n~w~Atingiu o limite de Guarda-Costas!");
  535.     }
  536.    }
  537.  
  538.    if (item == newbutton13 && bodyguardOn == true) // If statement
  539.    {
  540.     try {
  541.      peds.Last().Delete();
  542.      peds.Remove(peds.Last());
  543.      if (!peds.Any()) {
  544.       bodyguardOn = false;
  545.      }
  546.  
  547.     } catch {
  548.      UI.Notify("~r~ERROR: \n~w~Não foi possivel Eliminar o seu Guarda-Costas!");
  549.     }
  550.    }
  551.  
  552.   };
  553.   //Main Menu Clickable Items
  554.   menu.AddItem(list);
  555.   menu.OnItemSelect += (sender, item, index) => {
  556.    if (item == newbutton8) {
  557.     try {
  558.      Vehicle car = playerPed.CurrentVehicle;
  559.      car.NumberPlate = "MaC 2745";
  560.      car.CanWheelsBreak = false;
  561.      car.CanTiresBurst = false;
  562.      car.IsBulletProof = true;
  563.      car.IsPersistent = true;
  564.      car.IsStolen = false;
  565.      car.ToggleMod(VehicleToggleMod.Turbo, true);
  566.      car.ToggleMod(VehicleToggleMod.TireSmoke, true);
  567.      car.ToggleMod(VehicleToggleMod.XenonHeadlights, true);
  568.      car.InstallModKit();
  569.      car.SetMod(VehicleMod.Engine, 3, true);
  570.      car.SetMod(VehicleMod.Suspension, 3, true);
  571.      car.SetMod(VehicleMod.Transmission, 2, true);
  572.      car.SetMod(VehicleMod.Brakes, 2, true);
  573.      car.SetMod(VehicleMod.Armor, 4, true);
  574.      car.Repair();
  575.      car.Wash();
  576.      UI.Notify("~g~Código Activado: \n~w~Carro Kitado e Reparado!");
  577.     } catch {
  578.      UI.Notify("~r~ERROR: \n~w~Não foi possivel Kitar o seu carro!");
  579.     }
  580.     // Wait(200);
  581.    }
  582.    if (item == list) {
  583.     int listIndex = list.Index;
  584.     WeaponHash currentHash = allweaponhashes[listIndex];
  585.     playerPed.Weapons.Give(currentHash, 9999, true, true);
  586.    }
  587.  
  588.  
  589.   };
  590.   sub2.OnCheckboxChange += (sender, item, checked_) => {
  591.    if (item == chk) // If statement
  592.    {
  593.     if (checked_ == true) {
  594.      superJump = true;
  595.      UI.Notify("~g~Código Activado: \n~w~Super Jump");
  596.     } else if (checked_ == false) {
  597.      superJump = false;
  598.      UI.Notify("~r~Código Desactivado: \n~w~Super Jump");
  599.     }
  600.    }
  601.    if (item == chk2) // If statement
  602.    {
  603.     if (checked_ == true) {
  604.  
  605.      player.SetRunSpeedMultThisFrame(1.49 f);
  606.  
  607.      UI.Notify("~g~Código Activado: \n~w~Super Run");
  608.     } else if (checked_ == false) {
  609.      dSpeed = false;
  610.      bla++;
  611.      player.SetRunSpeedMultThisFrame(bla);
  612.      bla--;
  613.      player.SetRunSpeedMultThisFrame(bla);
  614.      UI.ShowSubtitle("PlayerMaxSpeed: " + bla);
  615.      UI.Notify("~r~Código Desactivado: \n~w~Super Run");
  616.     }
  617.    }
  618.  
  619.   };
  620.  }
  621.  void toolTip(string text) {
  622.   Function.Call(Hash._SET_TEXT_COMPONENT_FORMAT, "STRING");
  623.   Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, text);
  624.   Function.Call(Hash._0x238FFE5C7B0498A6, 0, 0, 1, -1);
  625.  }
  626.  public MenuExample() {
  627.  
  628.   _menuPool = new MenuPool();
  629.   var mainMenu = new UIMenu("~g~NinjaRoot's Menu", "~b~Escolha Uma Opção...");
  630.   Menu1(mainMenu);
  631.   _menuPool.Add(mainMenu);
  632.   _menuPool.RefreshIndex();
  633.  
  634.   Tick += (o, e) => {
  635.    _menuPool.ProcessMenus();
  636.    if (playerPed.IsGettingIntoAVehicle) {
  637.     toolTip("Pressione ~INPUT_SPECIAL_ABILITY_SECONDARY~ para usar o Nitro.");
  638.    }
  639.    if (cnt >= cntMax) {
  640.     cnt = 0;
  641.    }
  642.    if (cnt <= cnt_d) {
  643.     marker = false;
  644.    } else {
  645.     marker = true;
  646.    }
  647.    if (playerPed.IsAlive && playerPed.IsVisible && playerPed.Health <= 100 && playerPed.Health >= 25) {
  648.     cnt += cnt_d2;
  649.     if (marker == false) {
  650.      playerPed.Health = playerPed.Health + 1;
  651.     }
  652.    }
  653.    if (superJump) {
  654.     player.SetSuperJumpThisFrame();
  655.    }
  656.    if (playerPed.IsInVehicle() == false) {
  657.     isAuto = false;
  658.     autoSpeed = 20;
  659.    }
  660.    if (Game.CurrentInputMode == InputMode.GamePad) {
  661.     if ((Game.IsControlPressed(2, GTA.Control.Aim)) && Game.IsControlPressed(2, GTA.Control.FrontendRs)) {
  662.      Vector3 camPos = Function.Call < Vector3 > (Hash.GET_GAMEPLAY_CAM_COORD);
  663.      Vector3 camRot = Function.Call < Vector3 > (Hash.GET_GAMEPLAY_CAM_ROT);
  664.      float retz = camRot.Z * 0.0174532924 F;
  665.      float retx = camRot.X * 0.0174532924 F;
  666.      float absx = (float) Math.Abs(Math.Cos(retx));
  667.      Vector3 camStuff = new Vector3((float) Math.Sin(retz) * absx * -1, (float) Math.Cos(retz) * absx, (float) Math.Sin(retx));
  668.      RaycastResult ray = World.Raycast(camPos, camPos + camStuff * 1000, IntersectOptions.Everything);
  669.      World.AddOwnedExplosion(playerPed, ray.HitCoords, ExplosionType.PlaneRocket, 0.5 f, 0 f);
  670.     }
  671.     if (Game.IsControlPressed(2, GTA.Control.FrontendRb) && Game.IsControlPressed(2, GTA.Control.FrontendRdown)) {
  672.      mainMenu.Visible = !mainMenu.Visible;
  673.      Wait(200);
  674.     }
  675.     if (Game.IsControlPressed(2, GTA.Control.FrontendY) && isAuto == true) {
  676.      playerPed.Task.ClearAllImmediately();
  677.      isAuto = false;
  678.      UI.Notify("~r~ERROR: \n~w~Viagem cancelada por saída de veiculo, perdeu ~g~10$");
  679.      playerPed.Money = playerPed.Money - 10;
  680.      Wait(200);
  681.     }
  682.     if (bodyguardOn == true && (Game.IsControlPressed(2, GTA.Control.Aim)) && (Game.IsControlPressed(2, GTA.Control.FrontendAccept))) {
  683.      UI.Notify("~g~BodyGuard Task: ~w~Atacar o Alvo!");
  684.      try
  685.  
  686.      {
  687.       Entity target = player.GetTargetedEntity();
  688.       foreach(Ped pedx in peds) {
  689.        pedx.Task.ClearAll();
  690.        Function.Call(Hash.TASK_SHOOT_AT_ENTITY, pedx, target, 5000, FiringPattern.FullAuto.GetHashCode());
  691.        Wait(1);
  692.       }
  693.      } catch {
  694.       UI.Notify("~r~ERROR: \n~w~Não foi possivel Executar o ataque de mira");
  695.      }
  696.      Wait(4800);
  697.  
  698.     }
  699.     if (mainMenu.Visible == false) {
  700.      if (Game.IsControlPressed(2, GTA.Control.FrontendLt) && Game.IsControlPressed(2, GTA.Control.PhoneRight)) {
  701.       UI.Notify("~g~Código Activado: \n~w~Remover Policia");
  702.       player.WantedLevel = 0;
  703.       Wait(200);
  704.      }
  705.      if (Game.IsControlPressed(2, GTA.Control.PhoneRight) && playerPed.IsInVehicle() == true) {
  706.       UI.Notify("~g~Código Activado: \n~w~Veiculo Arranjado");
  707.       playerPed.CurrentVehicle.Repair();
  708.       playerPed.CurrentVehicle.Wash();
  709.       Wait(200);
  710.      }
  711.     }
  712.    }
  713.   };
  714.   KeyDown += (o, e) => {
  715.    if (e.KeyCode == Keys.Z && !_menuPool.IsAnyMenuOpen()) {
  716.     mainMenu.Visible = !mainMenu.Visible;
  717.     Wait(200);
  718.    }
  719.  
  720.   };
  721.  
  722.  }
  723. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement