-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMain.cs
More file actions
51 lines (45 loc) · 1.5 KB
/
Main.cs
File metadata and controls
51 lines (45 loc) · 1.5 KB
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
using DemoProject.Callouts;
using LSPD_First_Response.Mod.API;
using Rage;
namespace DemoProject
{
/// <summary>
/// Do not rename! Attributes or inheritance based plugins will follow when the API is more in depth.
/// </summary>
public class Main : Plugin
{
/// <summary>
/// Constructor for the main class, same as the class, do not rename.
/// </summary>
public Main()
{
}
/// <summary>
/// Called when the plugin ends or is terminated to cleanup
/// </summary>
public override void Finally()
{
}
/// <summary>
/// Called when the plugin is first loaded by LSPDFR
/// </summary>
public override void Initialize()
{
//Event handler for detecting if the player goes on duty
Functions.OnOnDutyStateChanged += Functions_OnOnDutyStateChanged;
Game.LogTrivial("Callouts Plugin loaded!");
}
/// <summary>
/// The event handler mentioned above,
/// </summary>
static void Functions_OnOnDutyStateChanged(bool onDuty)
{
if (onDuty)
{
//If the player goes on duty we need to register our custom callouts
//Here we register our ExampleCallout class which is inside our Callouts folder (APIExample.Callouts namespace)
Functions.RegisterCallout(typeof(ChaseCallout));
}
}
}
}