diff --git a/Callouts/Test.cs b/Callouts/Test.cs new file mode 100644 index 0000000..3ae1907 --- /dev/null +++ b/Callouts/Test.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Rage; +using LSPD_First_Response.Mod.API; +using LSPD_First_Response.Mod.Callouts; +using System.Drawing; + +namespace Code_Blue_Calls.Callouts +{ + [CalloutInfo("Test", CalloutProbability.High)] + public class Test : Callout + { + private Ped suspect; + private Vehicle vehicle; + private Blip blip; + private LHandle Pursuit; + private Vector3 spawn; + private bool created; + public override bool OnBeforeCalloutDisplayed() + { + spawn = World.GetRandomPositionOnStreet(); + ShowCalloutAreaBlipBeforeAccepting(spawn, 30f); + //AddMaximumDistanceCheck(40, spawn); + CalloutMessage = "Test"; + CalloutPosition = spawn; + Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESISTING_ARREST_02 IN_OR_ON_POSITION", spawn); + return base.OnBeforeCalloutDisplayed(); + } + + public override bool OnCalloutAccepted() + { + vehicle = new Vehicle("BLISTA", spawn); + vehicle.IsPersistent = true; + suspect = new Ped(vehicle.GetOffsetPositionFront(5f)); + suspect.IsPersistent = true; + suspect.BlockPermanentEvents = true; + suspect.WarpIntoVehicle(vehicle, -1); + + blip = suspect.AttachBlip(); + blip.Color = System.Drawing.Color.Yellow; + blip.IsRouteEnabled = true; + + created = false; + + return base.OnCalloutAccepted(); + } + + public override void Process() + { + base.Process(); + + if (!created && Game.LocalPlayer.Character.DistanceTo(vehicle) <= 20f) + { + Pursuit = Functions.CreatePursuit(); + Functions.AddPedToPursuit(Pursuit, suspect); + Functions.SetPursuitIsActiveForPlayer(Pursuit, true); + + created = true; + } + if (created && !Functions.IsPursuitStillRunning(Pursuit)) + { + End(); + } + + } + public override void End() + { + base.End(); + + if (suspect.Exists()) + { + suspect.Dismiss(); + } + } + } +} diff --git a/Code Blue Calls.csproj b/Code Blue Calls.csproj index aa26f25..31dfa7b 100644 --- a/Code Blue Calls.csproj +++ b/Code Blue Calls.csproj @@ -82,7 +82,7 @@ - + diff --git a/Main.cs b/Main.cs index 9abd8c6..f262491 100644 --- a/Main.cs +++ b/Main.cs @@ -34,10 +34,14 @@ namespace Code_Blue_Calls { if (OnDuty) { +<<<<<<< HEAD // If the player goes on duty, register the callouts RegisterCallouts(); // Display a notification to indicate that the callouts have been loaded +======= + RegisterCallouts(); +>>>>>>> parent of ccc531b (Added domestic violence calout) Game.DisplayNotification("Code Blue Callouts loaded."); } } @@ -45,7 +49,7 @@ namespace Code_Blue_Calls // Register the callouts private static void RegisterCallouts() { - Functions.RegisterCallout(typeof(Callouts.DomesticViolence)); + Functions.RegisterCallout(typeof(Callouts.Test)); } // Event handler for resolving LSPDFR-related assemblies