Advertisement
Guest User

Untitled

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