public override void End() { PedHelper.DeclareSubjectStatus(suspect); if (suspect.Exists()) { Game.LogTrivial("[DiamondCasinoTrouble/HotCallouts] Attmepting to dismiss suspect..."); if (!Functions.IsPedArrested(suspect)) { suspect.Dismiss(); } else { Game.LogTrivial("[DiamondCasinoTrouble/HotCallouts] Suspect was not dismissed to prevent them taking over player vehicle."); } } if (security.Exists()) { security.Dismiss(); } if (susB.Exists()) { susB.Delete(); } if (b.Exists()) { b.Delete(); } base.End(); }
static internal void OnListChangedHandler(UIMenu sender, UIMenuListItem list, int newindex) { switch (list.Text) { case "Ped Model": if (Ped != null) { Ped.Delete(); } PedHash hash = PedHelper.GetPedFromString(list.Items[newindex].ToString()); Ped = World.CreatePed(hash, Game.Player.Character.GetOffsetPosition(new Vector3(0, 2, 0)), Rotation); CurrentPedHash = hash; break; } }
public override void Process() { base.Process(); if (!approach && Game.LocalPlayer.Character.Position.DistanceTo(suspect) < 30f) { approach = true; Game.DisplayHelp("Perform a traffic stop to target " + suspectVehicle.Model.Name + "."); } /* * if(!pursuited && Game.LocalPlayer.Character.Position.DistanceTo(suspect) < 30f) * { * pursuit = Functions.CreatePursuit(); * Functions.AddPedToPursuit(pursuit, suspect); * Functions.SetPursuitIsActiveForPlayer(pursuit, true); * pursuited = true; * ScannerHelper.DisplayDispatchDialogue("You", "To dispatch, suspect fleeing."); * ScannerHelper.DisplayDispatchDialogue("Dispatch", "Affirmtive, suspect plate " + suspectVehicle.LicensePlate.ToUpper() + ", vehicle " + suspectVehicle.Model.Name); * Functions.RequestBackup(suspect.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); * } * * if(pursuited && !Functions.IsPursuitStillRunning(pursuit)) * { * PedHelper.DeclareSubjectStatus(suspect); * End(); * } */ if (!inPursuit && Functions.IsPedInPursuit(suspect)) { inPursuit = true; ScannerHelper.DisplayDispatchDialogue("You", "To dispatch, suspect fleeing."); } if (!suspect.Exists() || suspect.IsDead || Functions.IsPedArrested(suspect)) { PedHelper.DeclareSubjectStatus(suspect); End(); } }
private void OnTick(object sender, EventArgs e) { if (DatabaseHandler.initialised && !instantiated) { Instantiate(); } if (DatabaseHandler.initialised && instantiated) { PedHelper.CheckNearbyDealer(); if (DatabaseHandler.dealerInRangeIndex != null && DatabaseHandler.dealerInventory != null) { if (GlobalVariables.dealerMenu == null) { DealerMenu.CreateMenu(DatabaseHandler.dealers[(int)DatabaseHandler.dealerInRangeIndex]); } } else { GlobalVariables.dealerMenu = null; } } }
public static void CreateMenu() { GlobalVariables.devMenu = new UIMenu("", ""); GlobalVariables.devMenu.OnItemSelect += OnItemSelectHandler; GlobalVariables.devMenu.OnListChange += OnListChangedHandler; GlobalVariables.devMenu.OnSliderChange += OnSliderChangedHandler; if (File.Exists(GlobalVariables.DevMenuBanner)) { GlobalVariables.devMenu.SetBannerType(GlobalVariables.DevMenuBanner); } GlobalVariables.devMenu.AddItem(new UIMenuListItem("Ped Model", PedHelper.GetPedHashList(), 0, "Load the selected character.")); GlobalVariables.devMenu.AddItem(new UIMenuSliderItem("Ped Rotation", "Set the ped rotation") { Maximum = 360, Value = 180 }); GlobalVariables.devMenu.AddItem(new UIMenuItem("~r~Clear Ped", "Clears the ped model")); GlobalVariables.devMenu.AddItem(new UIMenuItem("~g~Add Dealer Location", "Adds a new dealer location")); GlobalVariables.devMenu.AddItem(new UIMenuItem("~r~Remove Dealer Location", "Removes dealer within interaction range")); GlobalVariables.pool.Add(GlobalVariables.devMenu); }
public PedHash GetPedHash() { return(PedHelper.GetPedFromString(PedName)); }