Skip to content

Commit 77e0b0a

Browse files
1.1 release
1 parent b78bbcd commit 77e0b0a

20 files changed

+99
-12
lines changed

CarCallout/BusPursuit.cs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Threading.Tasks;
4+
using CitizenFX.Core;
5+
using CitizenFX.Core.Native;
6+
using FivePD.API;
7+
using FivePD.API.Utils;
8+
9+
10+
namespace CarCallout
11+
{
12+
13+
[CalloutProperties("Bus Pursuit", "BGHDDevelopment", "1.1")]
14+
public class BusPursuit : Callout
15+
{
16+
private Vehicle car;
17+
Ped driver;
18+
public BusPursuit()
19+
{
20+
21+
Random rnd = new Random();
22+
float offsetX = rnd.Next(100, 700);
23+
float offsetY = rnd.Next(100, 700);
24+
25+
InitInfo(World.GetNextPositionOnStreet(Game.PlayerPed.GetOffsetPosition(new Vector3(offsetX, offsetY, 0))));
26+
ShortName = "Bus Pursuit";
27+
CalloutDescription = "A bus has been stolen!";
28+
ResponseCode = 3;
29+
StartDistance = 250f;
30+
}
31+
32+
public async override void OnStart(Ped player)
33+
{
34+
base.OnStart(player);
35+
Random random = new Random();
36+
car = await SpawnVehicle(VehicleHash.Bus, Location,12);
37+
driver = await SpawnPed(RandomUtils.GetRandomPed(), Location + 2);
38+
driver.SetIntoVehicle(car, VehicleSeat.Driver);
39+
40+
driver.AlwaysKeepTask = true;
41+
driver.BlockPermanentEvents = true;
42+
43+
PlayerData playerData = Utilities.GetPlayerData();
44+
string displayName = playerData.DisplayName;
45+
VehicleData datacar = await Utilities.GetVehicleData(car.NetworkId);
46+
string vehicleName = datacar.Name;
47+
Notify("~r~[CarCallouts] ~y~Officer ~b~" + displayName + ",~y~ the suspects are driving a " + vehicleName + "!");
48+
49+
driver.Task.CruiseWithVehicle(car, 2f, 387);
50+
car.AttachBlip();
51+
driver.AttachBlip();
52+
API.AddBlipForEntity(car.GetHashCode());
53+
API.AddBlipForEntity(driver.GetHashCode());
54+
}
55+
56+
public async override Task OnAccept()
57+
{
58+
InitBlip();
59+
UpdateData();
60+
}
61+
62+
private void Notify(string message)
63+
{
64+
API.BeginTextCommandThefeedPost("STRING");
65+
API.AddTextComponentSubstringPlayerName(message);
66+
API.EndTextCommandThefeedPostTicker(false, true);
67+
}
68+
private void DrawSubtitle(string message, int duration)
69+
{
70+
API.BeginTextCommandPrint("STRING");
71+
API.AddTextComponentSubstringPlayerName(message);
72+
API.EndTextCommandPrint(duration, false);
73+
}
74+
}
75+
}

CarCallout/CarCallout.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<Reference Include="System.Xml" />
4848
</ItemGroup>
4949
<ItemGroup>
50+
<Compile Include="BusPursuit.cs" />
5051
<Compile Include="OversizedCar.cs" />
5152
<Compile Include="PursuitCallout.cs" />
5253
<Compile Include="Properties\AssemblyInfo.cs" />

CarCallout/OversizedCar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace CarCallout
99
{
1010

11-
[CalloutProperties("Oversized Vehicle Callout", "BGHDDevelopment", "1.0.1")]
11+
[CalloutProperties("Oversized Vehicle Callout", "BGHDDevelopment", "1.1")]
1212
public class OversizedCar : Callout
1313
{
1414
private Vehicle car;

CarCallout/PursuitCallout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace CarCallout
1111
{
1212

13-
[CalloutProperties("Pursuit of Armed Suspects", "BGHDDevelopment", "1.0.1")]
13+
[CalloutProperties("Pursuit of Armed Suspects", "BGHDDevelopment", "1.1")]
1414
public class PursuitCallout : Callout
1515
{
1616
private Vehicle car;

CarCallout/RecklessDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace CarCallout
1111
{
1212

13-
[CalloutProperties("Reckless Driver Callout", "BGHDDevelopment", "1.0.1")]
13+
[CalloutProperties("Reckless Driver Callout", "BGHDDevelopment", "1.1")]
1414
public class RecklessDriver : Callout
1515
{
1616
private Vehicle car;

CarCallout/ReverseCarCallout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace CarCallout
1111
{
1212

13-
[CalloutProperties("Reverse Car Callout", "BGHDDevelopment", "1.0.1")]
13+
[CalloutProperties("Reverse Car Callout", "BGHDDevelopment", "1.1")]
1414
public class ReverseCarCallout : Callout
1515
{
1616
private Vehicle car;

CarCallout/SlowDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace CarCallout
1111
{
1212

13-
[CalloutProperties("Slow Driver Callout", "BGHDDevelopment", "1.0.1")]
13+
[CalloutProperties("Slow Driver Callout", "BGHDDevelopment", "1.1")]
1414
public class SlowDriver : Callout
1515
{
1616
private Vehicle car;

CarCallout/SmallCar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace CarCallout
1010
{
1111

12-
[CalloutProperties("Small Vehicle Callout", "BGHDDevelopment", "1.0.1")]
12+
[CalloutProperties("Small Vehicle Callout", "BGHDDevelopment", "1.1")]
1313
public class SmallCar : Callout
1414
{
1515
private Vehicle car;

CarCallout/StolenAmbul.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace CarCallout
1111
{
1212

13-
[CalloutProperties("Stolen Ambulance Car Callout", "BGHDDevelopment", "1.0.1")]
13+
[CalloutProperties("Stolen Ambulance Car Callout", "BGHDDevelopment", "1.1")]
1414
public class StolenAmbul : Callout
1515
{
1616
private Vehicle car;

CarCallout/StolenFireTruck.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace CarCallout
1111
{
1212

13-
[CalloutProperties("Stolen Firetruck Callout", "BGHDDevelopment", "1.0.1")]
13+
[CalloutProperties("Stolen Firetruck Callout", "BGHDDevelopment", "1.1")]
1414
public class StolenFireTruck : Callout
1515
{
1616
private Vehicle car;

0 commit comments

Comments
 (0)