This repository has been archived by the owner on Jul 14, 2019. It is now read-only.
/
Main.cs
59 lines (49 loc) · 1.53 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using LSPD_First_Response.Engine.Scripting.Entities;
using Rage;
using LSPD_First_Response.Mod.API;
namespace GetPedHeadshotTxdCrashPOC
{
public class Main : Plugin
{
public static Ped ped;
public static Blip blip;
public override void Initialize()
{
Game.LogTrivial($"Init {Assembly.GetExecutingAssembly().FullName}");
Functions.OnOnDutyStateChanged += Functions_OnOnDutyStateChanged;
}
public override void Finally()
{
if (ped)
{
ped.Delete();
}
if (blip)
{
blip.Delete();
}
return;
}
private void Functions_OnOnDutyStateChanged(bool onDuty)
{
if (onDuty) {
ped = new Ped();
blip = ped.AttachBlip();
ped.SetPositionWithSnap(Game.LocalPlayer.Character.GetOffsetPositionFront(3.0f));
Persona newPersona = new Persona("Testy", "McTestFace", LSPD_First_Response.Gender.Male);
Functions.SetPersonaForPed(ped, newPersona);
Game.DisplaySubtitle("Now cause the ped to be Stopped by Player by holding 'E' and ask for ID.");
}
else
{
Finally();
}
}
}
}