Advertisement
Guest User

GTA V: Hunk's BodyGuards script(edited & almost final)

a guest
Feb 8th, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 58.51 KB | None | 0 0
  1. using GTA;
  2. using GTA.Math;
  3. using GTA.Native;
  4. using iFruitAddon2;
  5. using NativeUI;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Drawing;
  9. using System.Linq;
  10. using System.Windows.Forms;
  11.  
  12. namespace BodyGuards
  13. {
  14.     public class BodyGuards : Script
  15.     {
  16.         private ScriptSettings config = ScriptSettings.Load("scripts\\BodyGuards\\BodyGuards.ini");
  17.         private int GameTimeRef = 0;
  18.         private bool firstLoad = false;
  19.         private int timeOut = 0;
  20.         private int timeOut2 = 0;
  21.         private List<Ped> BodyGuardsList = new List<Ped>();
  22.         private List<Ped> BodyGuardsListToLoad = new List<Ped>();
  23.         private bool speaking = false;
  24.         private int speechTimer = 0;
  25.         private bool arrange = false;
  26.         private bool greeting = false;
  27.         private int guardNumber = 1;
  28.         private bool numberSelected = false;
  29.         private bool allInVehicle = false;
  30.         private int i = 0;
  31.         private int price = ScriptSettings.Load("scripts\\BodyGuards\\BodyGuards.ini").GetValue<int>("SETTINGS", "PRICE", 5000);
  32.         private bool notified = false;
  33.         private bool payed = false;
  34.         private bool waitForPayment = false;
  35.         private int waitForPaymentTimer = 0;
  36.         private int noteTimer = 0;
  37.         private bool followAutoOrder = true;
  38.         private bool shortFormation = false;
  39.         private bool inMenu = false;
  40.         private List<UIMenu> mainMenuListUI = new List<UIMenu>();
  41.         private List<object> mainMenuListString = new List<object>();
  42.         private Color btnColor1 = Color.Empty;
  43.         private Color btnColor2 = Color.White;
  44.         private bool disbandProcess = false;
  45.         private int disbandTimer = 0;
  46.         private CustomiFruit _iFruit;
  47.         private iFruitContact contactA;
  48.         private Vehicle guardsVehicle;
  49.         private int playersGroup;
  50.         private MenuPool modMenuPool;
  51.         private UIMenu mainMenu;
  52.  
  53.  
  54.  
  55.  
  56.         public BodyGuards()
  57.         {
  58.             this.Tick += new EventHandler(this.OnTick);
  59.             this._iFruit = new CustomiFruit();
  60.             this.contactA = new iFruitContact("Call bodyguards");
  61.             this.contactA.Answered += new ContactAnsweredEvent(this.ContactAnsweredDate);
  62.             this.contactA.DialTimeout = 3;
  63.             this.contactA.Active = true;
  64.             this.contactA.Icon = ContactIcon.MP_Merryweather;
  65.             this.contactA.Bold = false;
  66.             this._iFruit.Contacts.Add(this.contactA);
  67.         }
  68.  
  69.         private int GetHashKey(string value)
  70.         {
  71.             return Function.Call<int>(Hash._0xD24D37CC275948CC, (InputArgument)value);
  72.         }
  73.  
  74.         private void groupFormationFunc(int group, int formation)
  75.         {
  76.             Function.Call(Hash._0xCE2F5FC3AF7E8C1E, (InputArgument)group, (InputArgument)formation);
  77.         }
  78.  
  79.         private void groupDistanceFunc(int group, float x, float y, float z)
  80.         {
  81.             Function.Call(Hash._0x1D9D45004C28C916, (InputArgument)group, (InputArgument)x, (InputArgument)y, (InputArgument)z);
  82.         }
  83.  
  84.         private void addToGroup(Ped guard)
  85.         {
  86.             if (Function.Call<bool>(Hash._0x5891CAC5D4ACFF74, (InputArgument)guard, (InputArgument)this.playersGroup))
  87.                 return;
  88.             Function.Call(Hash._0x9F3480FE65DB31B5, (InputArgument)guard, (InputArgument)this.playersGroup);
  89.         }
  90.  
  91.         private void removeFromGroup(Ped guard)
  92.         {
  93.             if (!Function.Call<bool>(Hash._0x5891CAC5D4ACFF74, (InputArgument)guard, (InputArgument)this.playersGroup))
  94.                 return;
  95.             Function.Call(Hash._0xED74007FFB146BC2, (InputArgument)guard, (InputArgument)this.playersGroup);
  96.         }
  97.  
  98.         private void groupPositive()
  99.         {
  100.             foreach (Ped bodyGuards in this.BodyGuardsList)
  101.                 bodyGuards.Task.ClearAll();
  102.             Function.Call(Hash._0x8E04FEDD28D42462, (InputArgument)this.BodyGuardsList.ElementAt<Ped>(0), (InputArgument)"GENERIC_YES", (InputArgument)"SPEECH_PARAMS_FORCE", (InputArgument)1);
  103.         }
  104.  
  105.  
  106.  
  107.         private void onMenuClose(UIMenu sender)
  108.         {
  109.             this.mainMenuListString.Clear();
  110.             this.ClosePhoneFunc(0, 100);
  111.             this.inMenu = false;
  112.         }
  113.  
  114.         private void ContactAnsweredDate(iFruitContact contact)
  115.         {
  116.             this._iFruit.Close(0);
  117.             if (Game.Player.Character.Model == (Model)PedHash.Michael)
  118.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)0);
  119.             if (Game.Player.Character.Model == (Model)PedHash.Franklin)
  120.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)2);
  121.             if (Game.Player.Character.Model == (Model)PedHash.Trevor)
  122.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)1);
  123.             if (Game.Player.Character.Model != (Model)PedHash.Michael && Game.Player.Character.Model != (Model)PedHash.Franklin && Game.Player.Character.Model != (Model)PedHash.Trevor)
  124.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)0);
  125.             if (this.BodyGuardsList.Count<Ped>() > 0)
  126.                 this.inMenu = true;
  127.             else if (!this.waitForPayment)
  128.             {
  129.                 this.notified = false;
  130.                 this.price = 5000;
  131.                 this.guardNumber = 1;
  132.                 this.speaking = true;
  133.                 this.speechTimer = 0;
  134.                 this.arrange = true;
  135.                 this.payed = false;
  136.             }
  137.             else if (!this.payed)
  138.             {
  139.                 if (Game.Player.Money >= this.price / 100 * 5)
  140.                 {
  141.                     this.payed = true;
  142.                     Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  143.                     this.notify("Thank you for choosing our ~y~Company");
  144.                     this.notify("We send bodyguards to your current ~g~Location");
  145.                     Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  146.                     Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  147.                     Function.Call(Hash._0x17430B918701C342, (InputArgument)0, (InputArgument)0, (InputArgument)0, (InputArgument)200);
  148.                     Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_BANK_MAZE", (InputArgument)"CHAR_BANK_MAZE", (InputArgument)true, (InputArgument)7, (InputArgument)"~b~MAZE:", (InputArgument)"Payment transaction ~o~5%~w~ is written off", (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  149.                     Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  150.                     Game.Player.Money -= this.price + this.price / 100 * 5;
  151.                     Script.Wait(3000);
  152.                     if (!Game.IsScreenFadedOut && !Game.IsScreenFadingOut)
  153.                     {
  154.                         this.ClosePhoneFunc(0, 0);
  155.                         Game.Player.Character.Task.ClearSecondary();
  156.                         this.speechTimer = 0;
  157.                         this.speaking = false;
  158.                         this.arrange = false;
  159.                         UI.Notify("Backup is on the way!", true);
  160.                         Game.PlaySound("PICK_UP_WEAPON", "HUD_FRONTEND_CUSTOM_SOUNDSET");
  161.                         Script.Wait(2000);
  162.                     }
  163.                     this.guardsVehicleCreateFunc();
  164.                     for (this.i = 0; this.i < this.guardNumber; ++this.i)
  165.                         this.guardsCreateFunc(PedHash.Blackops01SMY);
  166.                     this.greeting = true;
  167.                     foreach (Ped bodyGuards in this.BodyGuardsList)
  168.                     {
  169.                         if ((Entity)bodyGuards != (Entity)null && (bodyGuards.Exists() && bodyGuards.IsAlive && !bodyGuards.IsInVehicle(this.guardsVehicle) && (Entity)this.guardsVehicle != (Entity)null && this.guardsVehicle.Exists()))
  170.                         {
  171.                             if (this.guardsVehicle.IsSeatFree(VehicleSeat.Driver))
  172.                                 bodyGuards.SetIntoVehicle(this.guardsVehicle, VehicleSeat.Driver);
  173.                             else
  174.                                 bodyGuards.SetIntoVehicle(this.guardsVehicle, VehicleSeat.Any);
  175.                         }
  176.                     }
  177.                     this.waitForPayment = false;
  178.                     this.payed = false;
  179.                 }
  180.                 else
  181.                 {
  182.                     this.payed = false;
  183.                     this.waitForPayment = false;
  184.                     this.clearScriptFunction();
  185.                     Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  186.                     Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  187.                     Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  188.                     Function.Call(Hash._0x17430B918701C342, (InputArgument)0, (InputArgument)0, (InputArgument)0, (InputArgument)200);
  189.                     Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_BANK_MAZE", (InputArgument)"CHAR_BANK_MAZE", (InputArgument)true, (InputArgument)7, (InputArgument)"~b~MAZE:", (InputArgument)"Payment transaction ~r~Failed", (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  190.                     Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  191.                     Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  192.                     Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  193.                     Function.Call(Hash._0x17430B918701C342, (InputArgument)0, (InputArgument)0, (InputArgument)0, (InputArgument)200);
  194.                     Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_BANK_MAZE", (InputArgument)"CHAR_BANK_MAZE", (InputArgument)true, (InputArgument)7, (InputArgument)"~b~MAZE:", (InputArgument)"Not enough money on your Bank ~g~Account", (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  195.                     Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  196.                 }
  197.             }
  198.         }
  199.  
  200.         private void guardsCreateFunc(PedHash GuardModel)
  201.         {
  202.             Vector3 safeCoordForPed = World.GetSafeCoordForPed(new Vector3(Game.Player.Character.Position.X + 150f, Game.Player.Character.Position.Y + 150f, Game.Player.Character.Position.Z));
  203.             Ped ped = World.CreatePed((Model)GuardModel, safeCoordForPed);
  204.             PedHash[] values = (PedHash[])Enum.GetValues(typeof(PedHash));
  205.             if (!((Entity)ped != (Entity)null) || !ped.Exists() || !ped.IsAlive)
  206.                 return;
  207.             ped.RandomizeOutfit();
  208.             ped.Weapons.Give(WeaponHash.SMG, 999, false, false);
  209.             if (!this.BodyGuardsList.Contains(ped))
  210.                 this.BodyGuardsList.Add(ped);
  211.             if (!ped.CurrentBlip.Exists())
  212.                 ped.AddBlip();
  213.             if (ped.CurrentBlip.Exists())
  214.             {
  215.                 ped.CurrentBlip.Sprite = BlipSprite.Armor;
  216.                 ped.CurrentBlip.Name = "BodyGuard" + this.BodyGuardsList.IndexOf(ped).ToString();
  217.                 ped.CurrentBlip.Color = BlipColor.BlueDark;
  218.                 ped.CurrentBlip.IsFlashing = false;
  219.                 ped.CurrentBlip.Alpha = 200;
  220.             }
  221.             this.playersGroup = Function.Call<int>(Hash._0xF162E133B4E7A675, (InputArgument)Game.Player.Character);
  222.         }
  223.  
  224.         private void guardsVehicleCreateFunc()
  225.         {
  226.             VehicleHash vehicleHash = VehicleHash.Baller2;
  227.             bool flag = false;
  228.             Vehicle[] allVehicles = World.GetAllVehicles((Model)vehicleHash);
  229.             if (allVehicles == null || allVehicles.Length == 0)
  230.             {
  231.                 Vector3 position = new Vector3(Game.Player.Character.Position.X + 150f, Game.Player.Character.Position.Y + 150f, Game.Player.Character.Position.Z);
  232.                 World.GetSafeCoordForPed(position);
  233.                 this.guardsVehicle = World.CreateVehicle((Model)vehicleHash, position);
  234.                 if (!((Entity)this.guardsVehicle != (Entity)null) || !this.guardsVehicle.Exists())
  235.                     return;
  236.                 this.guardsVehicle.LockStatus = VehicleLockStatus.Unlocked;
  237.                 this.guardsVehicle.IsPersistent = true;
  238.                 this.guardsVehicle.IsBulletProof = true;
  239.                 this.guardsVehicle.PrimaryColor = VehicleColor.MetallicBlack;
  240.                 this.guardsVehicle.SecondaryColor = VehicleColor.MetallicBlack;
  241.                 this.guardsVehicle.InstallModKit();
  242.                 this.guardsVehicle.PlaceOnGround();
  243.                 this.guardsVehicle.PlaceOnNextStreet();
  244.             }
  245.             else
  246.             {
  247.                 foreach (Vehicle vehicle in allVehicles)
  248.                 {
  249.                     if ((Entity)vehicle != (Entity)null && vehicle.Exists() && ((Entity)vehicle != (Entity)null && vehicle.Exists() && (vehicle.PrimaryColor == VehicleColor.MetallicBlack && vehicle.SecondaryColor == VehicleColor.MetallicBlack) && vehicle.IsBulletProof && (double)vehicle.Position.DistanceTo(Game.Player.Character.Position) < 50.0))
  250.                     {
  251.                         this.guardsVehicle = vehicle;
  252.                         this.guardsVehicle.IsPersistent = true;
  253.                         this.guardsVehicle.LockStatus = VehicleLockStatus.Unlocked;
  254.                         flag = true;
  255.                         break;
  256.                     }
  257.                 }
  258.                 if (!flag && (Entity)this.guardsVehicle == (Entity)null)
  259.                 {
  260.                     Vector3 position = new Vector3(Game.Player.Character.Position.X + 150f, Game.Player.Character.Position.Y + 150f, Game.Player.Character.Position.Z);
  261.                     World.GetSafeCoordForPed(position);
  262.                     this.guardsVehicle = World.CreateVehicle((Model)vehicleHash, position);
  263.                     if ((Entity)this.guardsVehicle != (Entity)null && this.guardsVehicle.Exists())
  264.                     {
  265.                         this.guardsVehicle.LockStatus = VehicleLockStatus.Unlocked;
  266.                         this.guardsVehicle.IsPersistent = true;
  267.                         this.guardsVehicle.IsBulletProof = true;
  268.                         this.guardsVehicle.PrimaryColor = VehicleColor.MetallicBlack;
  269.                         this.guardsVehicle.SecondaryColor = VehicleColor.MetallicBlack;
  270.                         this.guardsVehicle.InstallModKit();
  271.                         this.guardsVehicle.PlaceOnGround();
  272.                         this.guardsVehicle.PlaceOnNextStreet();
  273.                     }
  274.                 }
  275.             }
  276.         }
  277.  
  278.         private void followInCar()
  279.         {
  280.             Vehicle LastCar1 = Game.Player.LastVehicle;
  281.             if (Game.Player.Character.IsInVehicle(LastCar1))
  282.             {
  283.                 foreach (Ped bodyGuards in this.BodyGuardsList)
  284.                 {
  285.  
  286.                     if (LastCar1 != null && LastCar1.Exists() && LastCar1.IsDriveable)
  287.                     {
  288.                         if (this.BodyGuardsList.IndexOf(bodyGuards) == 0)
  289.                         {
  290.                             if (!bodyGuards.IsInVehicle(LastCar1) || bodyGuards.SeatIndex != VehicleSeat.Driver)
  291.                             {
  292.                                 if (this.timeOut <= 0)
  293.                                 {
  294.                                     if (!Function.Call<bool>(Hash._0xBB062B2B5722478E, (InputArgument)bodyGuards))
  295.                                     {
  296.                                         bodyGuards.Task.EnterVehicle(LastCar1, VehicleSeat.Driver, -1, 10f);
  297.                                         this.timeOut = 300;
  298.                                     }
  299.                                 }
  300.                             }
  301.                         }
  302.                         else if (this.BodyGuardsList.ElementAt<Ped>(0).IsInVehicle(LastCar1))
  303.                         {
  304.                             if (bodyGuards.IsSittingInVehicle(LastCar1))
  305.                             {
  306.                                 this.allInVehicle = true;
  307.                             }
  308.                             else
  309.                             {
  310.                                 if (!Function.Call<bool>(Hash._0xBB062B2B5722478E, (InputArgument)bodyGuards))
  311.                                 {
  312.                                     if (this.timeOut2 > 0)
  313.                                         --this.timeOut2;
  314.                                     if (this.BodyGuardsList.IndexOf(bodyGuards) == 1 && this.timeOut2 <= 0)
  315.                                     {
  316.                                         bodyGuards.Task.EnterVehicle(this.BodyGuardsList.ElementAt<Ped>(0).CurrentVehicle, VehicleSeat.Passenger, -1, 5f);
  317.                                         this.timeOut2 = 100;
  318.                                     }
  319.                                     if (this.BodyGuardsList.IndexOf(bodyGuards) == 2 && this.timeOut2 <= 0)
  320.                                     {
  321.                                         bodyGuards.Task.EnterVehicle(this.BodyGuardsList.ElementAt<Ped>(0).CurrentVehicle, VehicleSeat.LeftRear, -1, 5f);
  322.                                         this.timeOut2 = 100;
  323.                                     }
  324.                                     if (this.BodyGuardsList.IndexOf(bodyGuards) == 3 && this.timeOut2 <= 0)
  325.                                     {
  326.                                         bodyGuards.Task.EnterVehicle(this.BodyGuardsList.ElementAt<Ped>(0).CurrentVehicle, VehicleSeat.RightRear, -1, 5f);
  327.                                         this.timeOut2 = 100;
  328.                                     }
  329.                                 }
  330.                                 this.allInVehicle = false;
  331.                             }
  332.                         }
  333.                     }
  334.                 }
  335.             }
  336.         }
  337.         private void clearScriptFunction()
  338.         {
  339.             foreach (Ped bodyGuards in this.BodyGuardsList)
  340.             {
  341.                 if (bodyGuards.Exists() && bodyGuards.IsAlive)
  342.                 {
  343.                     if (Function.Call<bool>(Hash._0x5891CAC5D4ACFF74, (InputArgument)bodyGuards, (InputArgument)this.playersGroup))
  344.                         Function.Call(Hash._0xED74007FFB146BC2, (InputArgument)bodyGuards, (InputArgument)this.playersGroup);
  345.                     bodyGuards.Task.FleeFrom(Game.Player.Character, -1);
  346.                 }
  347.                 if (bodyGuards.CurrentBlip.Exists())
  348.                     bodyGuards.CurrentBlip.Remove();
  349.             }
  350.             if ((Entity)this.guardsVehicle != (Entity)null)
  351.             {
  352.                 if (this.guardsVehicle.Exists())
  353.                     this.guardsVehicle.MarkAsNoLongerNeeded();
  354.                 this.guardsVehicle = (Vehicle)null;
  355.             }
  356.             this.mainMenuListString.Clear();
  357.             this.disbandProcess = false;
  358.             this.disbandTimer = 100;
  359.             this.inMenu = false;
  360.             this.arrange = false;
  361.             this.allInVehicle = false;
  362.             this.notified = false;
  363.             this.i = 0;
  364.             this.guardNumber = 1;
  365.             this.numberSelected = false;
  366.             this.greeting = false;
  367.             this.speaking = false;
  368.             this.speechTimer = 0;
  369.             this.price = 5000;
  370.             this.ClosePhoneFunc(0, 0);
  371.             this.BodyGuardsList.Clear();
  372.             this.followAutoOrder = true;
  373.         }
  374.  
  375.         private void ClosePhoneFunc(int ms, int ifruitCloseMS)
  376.         {
  377.             Script.Wait(ms);
  378.             this._iFruit.Close(ifruitCloseMS);
  379.             Function.Call(Hash._0x3BC861DF703E5097, Array.Empty<InputArgument>());
  380.             Game.Player.Character.Task.ClearSecondary();
  381.         }
  382.  
  383.         private void UsePhoneFunc()
  384.         {
  385.             if (Function.Call<bool>(Hash._0x2AFE52F782F25775, (InputArgument)Game.Player.Character))
  386.                 return;
  387.             if (Game.Player.Character.Model == (Model)PedHash.Michael)
  388.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)0);
  389.             if (Game.Player.Character.Model == (Model)PedHash.Franklin)
  390.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)2);
  391.             if (Game.Player.Character.Model == (Model)PedHash.Trevor)
  392.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)1);
  393.             if (Game.Player.Character.Model != (Model)PedHash.Michael && Game.Player.Character.Model != (Model)PedHash.Franklin && Game.Player.Character.Model != (Model)PedHash.Trevor)
  394.                 Function.Call(Hash._0xA4E8E696C532FBC7, (InputArgument)0);
  395.         }
  396.  
  397.         private void notify(string text)
  398.         {
  399.             Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  400.             Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  401.             Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  402.             Function.Call(Hash._0x17430B918701C342, (InputArgument)((int)byte.MaxValue), (InputArgument)0, (InputArgument)0, (InputArgument)200);
  403.             Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)true, (InputArgument)7, (InputArgument)"BODYGUARD SERVICE", (InputArgument)text, (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  404.             Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  405.         }
  406.  
  407.         private void notify2(string text, string subject)
  408.         {
  409.             Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  410.             Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  411.             Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  412.             Function.Call(Hash._0x17430B918701C342, (InputArgument)((int)byte.MaxValue), (InputArgument)0, (InputArgument)0, (InputArgument)200);
  413.             Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)true, (InputArgument)7, (InputArgument)text, (InputArgument)subject, (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  414.             Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  415.         }
  416.  
  417.         public void Draw(int w, int x, int y, int z)
  418.         {
  419.             Scaleform scaleform = new Scaleform(0);
  420.             scaleform.Load("instructional_buttons");
  421.             scaleform.CallFunction("CLEAR_ALL");
  422.             scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", (object)0);
  423.             scaleform.CallFunction("CREATE_CONTAINER");
  424.             scaleform.CallFunction("SET_DATA_SLOT", (object)0, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)y), (object)"Cancel");
  425.             scaleform.CallFunction("SET_DATA_SLOT", (object)1, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)x), (object)"Accept");
  426.             scaleform.CallFunction("SET_DATA_SLOT", (object)2, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)z), (object)"Add Guard");
  427.             scaleform.CallFunction("SET_DATA_SLOT", (object)3, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)w), (object)"Remove Guard");
  428.             scaleform.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", (object)-1);
  429.             scaleform.Render2D();
  430.         }
  431.  
  432.         public void Draw2(int y, int x)
  433.         {
  434.             Scaleform scaleform = new Scaleform(1);
  435.             scaleform.Load("instructional_buttons");
  436.             scaleform.CallFunction("CLEAR_ALL");
  437.             scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", (object)0);
  438.             scaleform.CallFunction("CREATE_CONTAINER");
  439.             scaleform.CallFunction("SET_DATA_SLOT", (object)0, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)y), (object)"Cancel");
  440.             scaleform.CallFunction("SET_DATA_SLOT", (object)1, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)x), (object)"Accept");
  441.             scaleform.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", (object)-1);
  442.             scaleform.Render2D();
  443.         }
  444.  
  445.         public void Draw3(int x, int y, int w, int s, int a, int d, int q, int r)
  446.         {
  447.             Scaleform scaleform = new Scaleform(2);
  448.             scaleform.Load("instructional_buttons");
  449.             scaleform.CallFunction("CLEAR_ALL");
  450.             scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", (object)0);
  451.             scaleform.CallFunction("CREATE_CONTAINER");
  452.             scaleform.CallFunction("SET_DATA_SLOT", (object)0, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)y), (object)"Cancel");
  453.             scaleform.CallFunction("SET_DATA_SLOT", (object)1, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)x), (object)"Weapons");
  454.             scaleform.CallFunction("SET_DATA_SLOT", (object)2, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)a), (object)"Default");
  455.             scaleform.CallFunction("SET_DATA_SLOT", (object)3, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)w), (object)"Circle");
  456.             scaleform.CallFunction("SET_DATA_SLOT", (object)4, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)d), (object)"Line");
  457.             scaleform.CallFunction("SET_DATA_SLOT", (object)5, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)s), (object)"Space");
  458.             scaleform.CallFunction("SET_DATA_SLOT", (object)6, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)q), (object)"Disband");
  459.             scaleform.CallFunction("SET_DATA_SLOT", (object)7, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)r), (object)"Move/stay");
  460.             scaleform.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", (object)-1);
  461.             scaleform.Render2D();
  462.         }
  463.  
  464.         public void Draw4(int v, int z, int y, int h, int q)
  465.         {
  466.             Scaleform scaleform = new Scaleform(3);
  467.             scaleform.Load("instructional_buttons");
  468.             scaleform.CallFunction("CLEAR_ALL");
  469.             scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", (object)0);
  470.             scaleform.CallFunction("CREATE_CONTAINER");
  471.             scaleform.CallFunction("SET_DATA_SLOT", (object)0, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)v), (object)"Drive to Waypoint");
  472.             scaleform.CallFunction("SET_DATA_SLOT", (object)1, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)z), (object)"Drive around");
  473.             scaleform.CallFunction("SET_DATA_SLOT", (object)2, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)y), (object)"Cancel");
  474.             scaleform.CallFunction("SET_DATA_SLOT", (object)3, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)h), (object)"Stop");
  475.             scaleform.CallFunction("SET_DATA_SLOT", (object)4, (object)Function.Call<string>(Hash._0x0499D7B09FC9B407, (InputArgument)2, (InputArgument)q), (object)"Rush");
  476.             scaleform.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", (object)-1);
  477.             scaleform.Render2D();
  478.         }
  479.  
  480.         private void OnKeyDown(object sender, KeyEventArgs e)
  481.         {
  482.         }
  483.  
  484.         void EndRoute()
  485.         {
  486.             if (EnRoute || Wandering)
  487.             {
  488.                 if (LastCar.Driver != null && !LastCar.IsSeatFree(VehicleSeat.Driver))
  489.                 {
  490.                     if (Game.Player.Character.IsInVehicle(LastCar))
  491.                     {
  492.                         blip = Function.Call<Blip>(Hash._0x1BEDE233E6CD2A1F, (InputArgument)8);
  493.                         if (!blip.Exists() && EnRoute)
  494.                         {
  495.                             foreach (Ped bodyGuards in BodyGuardsList)
  496.                             {
  497.                                 LastCar.Driver.DrivingSpeed = 0;
  498.                                 Wait(7000);
  499.                                 LastCar.Driver.Task.ClearAll();
  500.                                 EnRoute = false;
  501.                             }
  502.  
  503.                         }
  504.                     }
  505.                     else
  506.                     {
  507.                         foreach (Ped bodyGuards in BodyGuardsList)
  508.                         {
  509.                             EnRoute = false;
  510.                             Wandering = false;
  511.                             LastCar.Driver.DrivingSpeed = 0;
  512.                             Wait(7000);
  513.                             LastCar.Driver.Task.ClearAll();
  514.                             LastCar.Driver.Task.LeaveVehicle();
  515.                         }
  516.                     }
  517.                 }
  518.             }
  519.         }
  520.  
  521.  
  522.  
  523.         private bool Wandering = false;
  524.         private bool EnRoute = false;
  525.         private bool Rushing = false;
  526.         private Blip blip;
  527.         private Vehicle LastCar;
  528.  
  529.         private void OnTick(object sender, EventArgs e)
  530.         {
  531.  
  532.             this._iFruit.Update();
  533.             if (this.BodyGuardsList.Count<Ped>() > 0)
  534.             {
  535.                 this.contactA.Name = "Control Bodyguards";
  536.                 this.contactA.Active = true;
  537.                 this.contactA.DialTimeout = 10;
  538.             }
  539.             else if (!this.waitForPayment)
  540.             {
  541.                 this.contactA.Name = "Call Bodyguards";
  542.                 this.contactA.Active = true;
  543.                 this.contactA.DialTimeout = 10;
  544.             }
  545.             else
  546.             {
  547.                 this.contactA.Name = "Pay for Service";
  548.                 this.contactA.Active = true;
  549.                 this.contactA.DialTimeout = 10;
  550.             }
  551.             if (!this.firstLoad)
  552.                 this.firstLoad = true;
  553.             if (this.speaking)
  554.             {
  555.                 if (!Function.Call<bool>(Hash._0x2AFE52F782F25775, (InputArgument)Game.Player.Character))
  556.                     this.UsePhoneFunc();
  557.                 if (Function.Call<bool>(Hash._0x2AFE52F782F25775, (InputArgument)Game.Player.Character))
  558.                 {
  559.                     Function.Call(Hash._0xC4E2813898C97A4B, (InputArgument)false);
  560.                     Function.Call(Hash._0x015C49A93E3E086E, (InputArgument)true);
  561.                     this.UsePhoneFunc();
  562.                     if (this.arrange)
  563.                     {
  564.                         int x = 176;
  565.                         int y = 177;
  566.                         int z = 172;
  567.                         int w = 173;
  568.                         if (this.numberSelected)
  569.                         {
  570.                             this.Draw2(y, x);
  571.                             ++this.noteTimer;
  572.                             if (this.noteTimer >= 100)
  573.                             {
  574.                                 Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  575.                                 Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  576.                                 Function.Call(Hash._0x17430B918701C342, (InputArgument)((int)byte.MaxValue), (InputArgument)0, (InputArgument)0, (InputArgument)200);
  577.                                 Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)true, (InputArgument)7, (InputArgument)"BODYGUARD SERVICE", (InputArgument)("Number of Guards: ~g~" + (object)this.guardNumber + "~n~~w~ Cost: " + (object)this.price + " ~g~$"), (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  578.                                 Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  579.                                 this.noteTimer = 0;
  580.                             }
  581.                             if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)y))
  582.                             {
  583.                                 Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)1);
  584.                                 this.speaking = false;
  585.                                 this.speechTimer = 0;
  586.                                 this.clearScriptFunction();
  587.                             }
  588.                             if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)x))
  589.                             {
  590.                                 Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  591.                                 Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)4);
  592.                                 this.waitForPaymentTimer = 0;
  593.                                 this.waitForPayment = true;
  594.                                 this.speaking = false;
  595.                                 this.speechTimer = 0;
  596.                             }
  597.                         }
  598.                         else
  599.                         {
  600.                             DisplayHelpTextThisFrame("PRICE: " + (object)this.price + " ~g~$ ~w~~n~GUARDS ~y~: " + (object)this.guardNumber + " / ~y~4");
  601.                             this.Draw(w, x, y, z);
  602.                             if (!this.notified)
  603.                                 this.notified = true;
  604.                             if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)x))
  605.                             {
  606.                                 Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  607.                                 Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)4);
  608.                                 this.numberSelected = true;
  609.                                 this.waitForPayment = false;
  610.                                 this.waitForPaymentTimer = 0;
  611.                                 this.noteTimer = 70;
  612.                                 Script.Wait(1500);
  613.                             }
  614.                             if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)z))
  615.                             {
  616.                                 Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)3);
  617.                                 Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  618.                                 if (this.guardNumber < 4)
  619.                                 {
  620.                                     ++this.guardNumber;
  621.                                     this.price *= 2;
  622.                                 }
  623.                                 else
  624.                                     UI.Notify("Number of guards is ~y~Maximal", true);
  625.                             }
  626.                             if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)y))
  627.                             {
  628.                                 Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)1);
  629.                                 Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  630.                                 this.speaking = false;
  631.                                 this.speechTimer = 0;
  632.                                 this.clearScriptFunction();
  633.                             }
  634.                             if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)w))
  635.                             {
  636.                                 Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)3);
  637.                                 Function.Call(Hash._0x67C540AA08E4A6F5, (InputArgument)(-1), (InputArgument)"OTHER_TEXT", (InputArgument)"HUD_AWARDS");
  638.                                 if (this.guardNumber > 1)
  639.                                 {
  640.                                     --this.guardNumber;
  641.                                     this.price /= 2;
  642.                                 }
  643.                                 else
  644.                                     UI.Notify("Number of guards is ~y~Minimal", true);
  645.                             }
  646.                         }
  647.  
  648.                         void DisplayHelpTextThisFrame(string text)
  649.                         {
  650.                             Function.Call(Hash._0x8509B634FBE7DA11, (InputArgument)"STRING");
  651.                             Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)text);
  652.                             Function.Call(Hash._0x238FFE5C7B0498A6, (InputArgument)0, (InputArgument)0, (InputArgument)1, (InputArgument)(-1));
  653.                         }
  654.                     }
  655.                     else
  656.                     {
  657.                         ++this.speechTimer;
  658.                         if (this.speechTimer == 250)
  659.                         {
  660.                             DisplayHelpTextThisFrame("~BLIP_INFO_ICON~ The ~y~Deal ~w~has been ~r~canceled");
  661.                             this.clearScriptFunction();
  662.                             this.ClosePhoneFunc(0, 0);
  663.                         }
  664.  
  665.                         void DisplayHelpTextThisFrame(string text)
  666.                         {
  667.                             Function.Call(Hash._0x8509B634FBE7DA11, (InputArgument)"STRING");
  668.                             Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)text);
  669.                             Function.Call(Hash._0x238FFE5C7B0498A6, (InputArgument)0, (InputArgument)0, (InputArgument)1, (InputArgument)(-1));
  670.                         }
  671.                     }
  672.                 }
  673.             }
  674.             if (this.waitForPayment)
  675.             {
  676.                 if (this.waitForPaymentTimer < 2000)
  677.                 {
  678.                     ++this.noteTimer;
  679.                     if (this.noteTimer >= 100)
  680.                     {
  681.                         Function.Call(Hash._0x202709F4C58A0424, (InputArgument)"STRING");
  682.                         Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)"");
  683.                         Function.Call(Hash._0x17430B918701C342, (InputArgument)((int)byte.MaxValue), (InputArgument)0, (InputArgument)0, (InputArgument)200);
  684.                         Function.Call(Hash._0x531B84E7DA981FB6, (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)"CHAR_MP_MERRYWEATHER", (InputArgument)true, (InputArgument)7, (InputArgument)"BODYGUARD SERVICE", (InputArgument)("Number of Guards: ~g~" + (object)this.guardNumber + "~n~~w~ Cost: " + (object)this.price + " ~g~$"), (InputArgument)1f, (InputArgument)"", (InputArgument)4);
  685.                         Function.Call(Hash._0x2ED7843F8F801023, (InputArgument)true, (InputArgument)true);
  686.                         this.noteTimer = 0;
  687.                     }
  688.                     DisplayHelpTextThisFrame("~BLIP_INFO_ICON~ Pay for ~g~Bodyguard ~w~service with your ~y~Phone");
  689.                 }
  690.                 else
  691.                 {
  692.                     this.waitForPayment = false;
  693.                     this.payed = false;
  694.                     this.clearScriptFunction();
  695.                 }
  696.  
  697.                 void DisplayHelpTextThisFrame(string text)
  698.                 {
  699.                     Function.Call(Hash._0x8509B634FBE7DA11, (InputArgument)"STRING");
  700.                     Function.Call(Hash._0x6C188BE134E074AA, (InputArgument)text);
  701.                     Function.Call(Hash._0x238FFE5C7B0498A6, (InputArgument)0, (InputArgument)0, (InputArgument)1, (InputArgument)(-1));
  702.                 }
  703.             }
  704.             if (this.BodyGuardsList != null && this.BodyGuardsList.Count<Ped>() > 0 && !this.greeting && this.followAutoOrder)
  705.             {
  706.                 if (this.timeOut > 0)
  707.                     --this.timeOut;
  708.                 int num;
  709.                 if (!Game.Player.Character.IsInVehicle())
  710.                     num = Function.Call<bool>(Hash._0xBB062B2B5722478E, (InputArgument)Game.Player.Character) ? 1 : 0;
  711.                 else
  712.                     num = 1;
  713.                 if (num != 0)
  714.                 {
  715.                     followInCar();
  716.                 }
  717.                 else
  718.                 {
  719.                     foreach (Ped bodyGuards in this.BodyGuardsList)
  720.                     {
  721.                         if (bodyGuards.IsSittingInVehicle())
  722.                         {
  723.                             if ((double)Game.Player.Character.Position.DistanceTo(bodyGuards.Position) < 17.0 && bodyGuards.CurrentVehicle.IsStopped)
  724.                             {
  725.                                 if (!Function.Call<bool>(Hash._0x5891CAC5D4ACFF74, (InputArgument)bodyGuards, (InputArgument)this.playersGroup))
  726.                                     this.addToGroup(bodyGuards);
  727.                             }
  728.                         }
  729.                         else
  730.                             this.addToGroup(bodyGuards);
  731.                     }
  732.                 }
  733.             }
  734.             if (this.BodyGuardsList != null && this.BodyGuardsList.Count<Ped>() > 0 && this.greeting)
  735.             {
  736.                 Vector3 position;
  737.                 int num;
  738.                 if (!Game.Player.Character.IsInCombat)
  739.                 {
  740.                     position = Game.Player.Character.Position;
  741.                     num = (double)position.DistanceTo(this.BodyGuardsList.ElementAt<Ped>(0).Position) < 15.0 ? 1 : 0;
  742.                 }
  743.                 else
  744.                     num = 0;
  745.                 if ((Entity)this.guardsVehicle != (Entity)null)
  746.                 {
  747.                     position = Game.Player.Character.Position;
  748.                     if ((double)position.DistanceTo(this.guardsVehicle.Position) > 17.0)
  749.                     {
  750.                         if ((Entity)this.guardsVehicle.Driver != (Entity)null)
  751.                         {
  752.                             if (this.timeOut > 0)
  753.                                 --this.timeOut;
  754.                             if (this.timeOut <= 0)
  755.                             {
  756.                                 this.guardsVehicle.Driver.Task.DriveTo(this.guardsVehicle, Game.Player.Character.Position, 17f, 40f, 2883621);
  757.                                 this.timeOut = 200;
  758.                             }
  759.                         }
  760.                     }
  761.                     else
  762.                     {
  763.                         Ped driver = this.guardsVehicle.Driver;
  764.                         if (driver.IsInVehicle() && (Entity)driver != (Entity)null)
  765.                         {
  766.                             foreach (Ped passenger in this.guardsVehicle.Passengers)
  767.                             {
  768.                                 if (passenger.IsSittingInVehicle(this.guardsVehicle))
  769.                                 {
  770.                                     passenger.Task.LeaveVehicle();
  771.                                     Script.Wait(1000);
  772.                                     passenger.Task.TurnTo((Entity)Game.Player.Character);
  773.                                 }
  774.                             }
  775.                             if (driver.IsSittingInVehicle(this.guardsVehicle))
  776.                                 driver.Task.LeaveVehicle();
  777.                         }
  778.                         else
  779.                         {
  780.                             foreach (Ped bodyGuards in this.BodyGuardsList)
  781.                             {
  782.                                 if (this.timeOut > 0)
  783.                                     --this.timeOut;
  784.                                 if (this.BodyGuardsList.IndexOf(bodyGuards) == 0)
  785.                                 {
  786.                                     position = bodyGuards.Position;
  787.                                     if ((double)position.DistanceTo(Game.Player.Character.Position) > 3.5)
  788.                                     {
  789.                                         if (this.timeOut <= 0)
  790.                                         {
  791.                                             bodyGuards.Task.GoTo(Game.Player.Character.Position);
  792.                                             this.timeOut = 100;
  793.                                         }
  794.                                     }
  795.                                     else if (this.timeOut <= 0)
  796.                                     {
  797.                                         if (Function.Call<bool>(Hash._0xD71649DB0A545AA3, (InputArgument)bodyGuards, (InputArgument)Game.Player.Character, (InputArgument)10f))
  798.                                         {
  799.                                             bodyGuards.Task.ClearAll();
  800.                                             Function.Call(Hash._0x8E04FEDD28D42462, (InputArgument)bodyGuards, (InputArgument)"GENERIC_HI", (InputArgument)"SPEECH_PARAMS_FORCE", (InputArgument)1);
  801.                                             this.greeting = false;
  802.                                         }
  803.                                         else
  804.                                             bodyGuards.Task.TurnTo((Entity)Game.Player.Character);
  805.                                         this.timeOut = 100;
  806.                                     }
  807.                                 }
  808.                                 else if (!Function.Call<bool>(Hash._0xD71649DB0A545AA3, (InputArgument)bodyGuards, (InputArgument)Game.Player.Character, (InputArgument)10f))
  809.                                     bodyGuards.Task.TurnTo((Entity)Game.Player.Character, 300);
  810.                                 else
  811.                                     bodyGuards.Task.ClearAll();
  812.                             }
  813.                         }
  814.                     }
  815.                 }
  816.                 else
  817.                 {
  818.                     this.greeting = false;
  819.                 }
  820.             }
  821.             if (this.disbandProcess)
  822.             {
  823.                 if (this.disbandTimer > 0)
  824.                     --this.disbandTimer;
  825.                 else if (this.modMenuPool == null)
  826.                 {
  827.                     this.clearScriptFunction();
  828.                     this.disbandProcess = false;
  829.                 }
  830.             }
  831.             if (this.GameTimeRef < Game.GameTime)
  832.             {
  833.                 this.GameTimeRef = Game.GameTime + 1000;
  834.                 if (!this.speaking)
  835.                 {
  836.                     foreach (Ped bodyGuards in this.BodyGuardsList)
  837.                     {
  838.                         if ((Entity)bodyGuards != (Entity)null && ((!bodyGuards.Exists() || bodyGuards.IsDead) && bodyGuards.CurrentBlip.Exists()))
  839.                             bodyGuards.CurrentBlip.Remove();
  840.                     }
  841.                 }
  842.                 if (Game.Player.Character.IsDead)
  843.                     this.clearScriptFunction();
  844.             }
  845.             if (this.inMenu && Game.Player.Character.IsOnFoot)
  846.             {
  847.                 Function.Call(Hash._0xC4E2813898C97A4B, (InputArgument)false);
  848.                 Function.Call(Hash._0x015C49A93E3E086E, (InputArgument)true);
  849.                 this.UsePhoneFunc();
  850.                 int x = 176;
  851.                 int y = 177;
  852.                 int w = 172;
  853.                 int a = 174;
  854.                 int d = 175;
  855.                 int s = 173;
  856.                 int q = 179;
  857.                 int r = 178;
  858.                 this.Draw3(x, y, w, s, a, d, q, r);
  859.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)r))
  860.                 {
  861.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)4);
  862.                     this.groupPositive();
  863.                     if (this.followAutoOrder)
  864.                     {
  865.                         foreach (Ped bodyGuards in this.BodyGuardsList)
  866.                         {
  867.                             this.notify2("Group:", "Movement: ~o~Guard");
  868.                             this.followAutoOrder = false;
  869.                             this.removeFromGroup(bodyGuards);
  870.                             bodyGuards.CanSwitchWeapons = false;
  871.                             Weapon bestWeapon = bodyGuards.Weapons.BestWeapon;
  872.                             bodyGuards.Weapons.Select(bestWeapon.Hash, true);
  873.                             bodyGuards.Task.GuardCurrentPosition();
  874.                         }
  875.                     }
  876.                     else
  877.                     {
  878.                         foreach (Ped bodyGuards in this.BodyGuardsList)
  879.                         {
  880.                             this.notify2("Group:", "Movement: ~g~Follow");
  881.                             this.followAutoOrder = true;
  882.                             this.addToGroup(bodyGuards);
  883.                         }
  884.                     }
  885.                 }
  886.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)q))
  887.                 {
  888.                     this.notify("Hope you enjoyed our ~y~Service~w~,sir");
  889.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)1);
  890.                     this.inMenu = false;
  891.                     this.ClosePhoneFunc(0, 1000);
  892.                     Function.Call(Hash._0xB138AAB8A70D3C69, (InputArgument)"TREVOR_SMALL_01");
  893.                     this.groupPositive();
  894.                     this.disbandProcess = true;
  895.                     this.disbandTimer = 100;
  896.                 }
  897.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)y))
  898.                 {
  899.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)2);
  900.                     this.inMenu = false;
  901.                     this.ClosePhoneFunc(0, 1000);
  902.                 }
  903.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)x))
  904.                 {
  905.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)3);
  906.                     this.groupPositive();
  907.                     if (this.BodyGuardsList.ElementAt<Ped>(0).Weapons.Current.Group == WeaponGroup.Unarmed)
  908.                     {
  909.                         foreach (Ped bodyGuards in this.BodyGuardsList)
  910.                         {
  911.                             bodyGuards.CanSwitchWeapons = false;
  912.                             Weapon bestWeapon = bodyGuards.Weapons.BestWeapon;
  913.                             bodyGuards.Weapons.Select(bestWeapon.Hash, true);
  914.                             this.notify2("Group:", "Weapons: ~o~Free");
  915.                         }
  916.                     }
  917.                     else
  918.                     {
  919.                         foreach (Ped bodyGuards in this.BodyGuardsList)
  920.                         {
  921.                             this.notify2("Group:", "Weapons: ~g~Holsted");
  922.                             bodyGuards.CanSwitchWeapons = true;
  923.                             bodyGuards.Weapons.Select(WeaponHash.Unarmed, true);
  924.                         }
  925.                     }
  926.                 }
  927.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)a))
  928.                 {
  929.                     this.notify2("Group:", "Formation: ~o~Free");
  930.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)1);
  931.                     this.groupPositive();
  932.                     this.groupFormationFunc(Function.Call<int>(Hash._0xF162E133B4E7A675, (InputArgument)this.BodyGuardsList.ElementAt<Ped>(0)), 0);
  933.                 }
  934.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)w))
  935.                 {
  936.                     this.notify2("Group:", "Formation: ~y~Circle");
  937.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)2);
  938.                     this.groupPositive();
  939.                     this.groupFormationFunc(Function.Call<int>(Hash._0xF162E133B4E7A675, (InputArgument)this.BodyGuardsList.ElementAt<Ped>(0)), 1);
  940.                 }
  941.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)d))
  942.                 {
  943.                     this.notify2("Group:", "Formation: ~g~Line");
  944.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)3);
  945.                     this.groupPositive();
  946.                     this.groupFormationFunc(Function.Call<int>(Hash._0xF162E133B4E7A675, (InputArgument)this.BodyGuardsList.ElementAt<Ped>(0)), 3);
  947.                 }
  948.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)s))
  949.                 {
  950.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)4);
  951.                     this.groupPositive();
  952.                     int group = Function.Call<int>(Hash._0xF162E133B4E7A675, (InputArgument)this.BodyGuardsList.ElementAt<Ped>(0));
  953.                     if (this.shortFormation)
  954.                     {
  955.                         this.notify2("Group:", "Space range: ~o~Long");
  956.                         this.groupDistanceFunc(group, 5.5f, 5.5f, 5.5f);
  957.                         this.shortFormation = !this.shortFormation;
  958.                     }
  959.                     else
  960.                     {
  961.                         this.notify2("Group:", "Space range: ~g~Short");
  962.                         this.groupDistanceFunc(group, 2.5f, 2.5f, 2.5f);
  963.                         this.shortFormation = !this.shortFormation;
  964.                     }
  965.                 }
  966.  
  967.             }
  968.             else if (this.inMenu && Game.Player.Character.IsInVehicle())
  969.             {
  970.                 Function.Call(Hash._0xC4E2813898C97A4B, (InputArgument)false);
  971.                 Function.Call(Hash._0x015C49A93E3E086E, (InputArgument)true);
  972.                 this.UsePhoneFunc();
  973.                 int v = 51;
  974.                 int z = 72;
  975.                 int y = 177;
  976.                 int h = 179;
  977.                 int q = 171;
  978.                 this.Draw4(v, z, y, h, q);
  979.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)z))
  980.                 {
  981.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)1);
  982.                     LastCar = Game.Player.LastVehicle;
  983.                     if (!LastCar.IsSeatFree(VehicleSeat.Driver) && LastCar.Driver.IsSittingInVehicle(LastCar))
  984.                     {
  985.                         if (!Wandering)
  986.                         {
  987.                             LastCar.Driver.Task.ClearAll();
  988.                             Function.Call(Hash._0x480142959D337D00, (InputArgument)LastCar.Driver, (InputArgument)LastCar, (InputArgument)35f, (InputArgument)786603);
  989.                             Wandering = true;
  990.                             UI.Notify("Driving", true);
  991.                         }
  992.                         else
  993.                         {
  994.                             LastCar.Driver.DrivingSpeed = 0;
  995.                             Wait(3000);
  996.                             LastCar.Driver.Task.ClearAll();
  997.                             Wandering = false;
  998.                             UI.Notify("Cancelling", true);
  999.                         }
  1000.                     }
  1001.                     else
  1002.                     {
  1003.                         foreach (Ped bodyGuards in BodyGuardsList)
  1004.                         {
  1005.                             bodyGuards.Task.ClearAll();
  1006.                             bodyGuards.Task.EnterVehicle(LastCar, VehicleSeat.Driver, 6000, 10f);
  1007.                             UI.Notify("Driver not found.", true);
  1008.  
  1009.                         }
  1010.                     }
  1011.  
  1012.                 }
  1013.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)h))
  1014.                 {
  1015.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)3);
  1016.                     UI.Notify("Stopping.", true);
  1017.                     LastCar.Driver.DrivingSpeed = 0f;
  1018.                     Wait(7000);
  1019.                     LastCar.Driver.Task.ClearAll();
  1020.                     Wandering = false;
  1021.                     EnRoute = false;
  1022.                 }
  1023.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)q))
  1024.                 {
  1025.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)4);
  1026.                     if (!Rushing)
  1027.                     {
  1028.                         UI.Notify("Driving Style: Rush", true);
  1029.                         LastCar.Driver.DrivingStyle = DrivingStyle.Rushed;
  1030.                         Rushing = true;
  1031.                     }
  1032.                     else
  1033.                     {
  1034.                         UI.Notify("Driving Style: Normal", true);
  1035.                         Rushing = false;
  1036.                         LastCar.Driver.DrivingStyle = DrivingStyle.Normal;
  1037.                     }
  1038.                 }
  1039.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)y))
  1040.                 {
  1041.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)2);
  1042.                     this.inMenu = false;
  1043.                     this.ClosePhoneFunc(0, 1000);
  1044.                 }
  1045.                 if (Function.Call<bool>(Hash._0x91AEF906BCA88877, (InputArgument)0, (InputArgument)v))
  1046.                 {
  1047.                     Function.Call(Hash._0x95C9E72F3D7DEC9B, (InputArgument)2);
  1048.                     blip = Function.Call<Blip>(Hash._0x1BEDE233E6CD2A1F, (InputArgument)8);
  1049.                     LastCar = Game.Player.LastVehicle;
  1050.                     Ped LastCarDriver = LastCar.Driver;
  1051.                     Ped Player1 = Game.Player.Character;
  1052.  
  1053.                     if (LastCarDriver == Player1)
  1054.                     {
  1055.                         return;
  1056.                     }
  1057.                     foreach (Ped bodyGuards in BodyGuardsList)
  1058.                     {
  1059.                         if (blip.Exists() && Game.Player.Character.IsInVehicle(LastCar))
  1060.                         {
  1061.                             if (!LastCar.IsSeatFree(VehicleSeat.Driver))
  1062.                             {
  1063.                                 bodyGuards.Task.ClearAll();
  1064.                                 LastCar.Driver.Task.ClearAll();
  1065.                                 LastCar.Driver.Task.DriveTo(LastCar, World.GetWaypointPosition(), 10f, 40f, 786603);
  1066.                                 UI.Notify("Driving to waypoint.", true);
  1067.                                 EnRoute = true;
  1068.                                 break;
  1069.                             }
  1070.                             else
  1071.                             {
  1072.                                 bodyGuards.Task.ClearAll();
  1073.                                 bodyGuards.Task.EnterVehicle(LastCar, VehicleSeat.Driver, 6000, 10f);
  1074.                                 UI.Notify("Driver not in vehicle.", true);
  1075.                                 break;
  1076.                             }
  1077.                         }
  1078.                         else
  1079.                         {
  1080.                             LastCar.Speed = 0f;
  1081.                             Wait(6000);
  1082.                             LastCarDriver.Task.ClearAll();
  1083.                             UI.Notify("Waypoint not set.", true);
  1084.                         }
  1085.                     }
  1086.                 }
  1087.             }
  1088.             EndRoute();
  1089.         }
  1090.     }
  1091. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement