testasdasd

master
Supopur 1 year ago
parent 6b2d0299f2
commit 546bb77c6e

@ -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();
}
}
}
}

@ -82,7 +82,7 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Callouts\DomesticViolence.cs" /> <Compile Include="Callouts\Test.cs" />
<Compile Include="IniFile.cs" /> <Compile Include="IniFile.cs" />
<Compile Include="Main.cs" /> <Compile Include="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

@ -34,10 +34,14 @@ namespace Code_Blue_Calls
{ {
if (OnDuty) if (OnDuty)
{ {
<<<<<<< HEAD
// If the player goes on duty, register the callouts // If the player goes on duty, register the callouts
RegisterCallouts(); RegisterCallouts();
// Display a notification to indicate that the callouts have been loaded // 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."); Game.DisplayNotification("Code Blue Callouts loaded.");
} }
} }
@ -45,7 +49,7 @@ namespace Code_Blue_Calls
// Register the callouts // Register the callouts
private static void RegisterCallouts() private static void RegisterCallouts()
{ {
Functions.RegisterCallout(typeof(Callouts.DomesticViolence)); Functions.RegisterCallout(typeof(Callouts.Test));
} }
// Event handler for resolving LSPDFR-related assemblies // Event handler for resolving LSPDFR-related assemblies

Loading…
Cancel
Save