-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathEntryPoint.cs
More file actions
48 lines (43 loc) · 1.39 KB
/
EntryPoint.cs
File metadata and controls
48 lines (43 loc) · 1.39 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
using System;
using LSPD_First_Response;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
using Rage;
using StraysCallouts.Callouts;
namespace StraysCallouts
{
/// <summary>
/// Inherit Plugin, since this is a plugin.
/// </summary>
public class EntryPoint : Plugin
{
/// <summary>
/// This method is run when the plugin is first initialized.
/// </summary>
public override void Initialize()
{
//Subscribe to the OnOnDutyStateChanged event, so we don't register our callouts unless the player is on duty.
Functions.OnOnDutyStateChanged += this.OnDutyStateChangedEvent;
//Logging is a great tool, so we log to make sure the plugins loaded.
Game.LogTrivial("StraysCallouts initialized");
}
/// <summary>
/// Called when the OnOnDutyStateChanged event is raised.
/// </summary>
/// <param name="onDuty"></param>
public void OnDutyStateChangedEvent(bool onDuty)
{
//If the player is going on duty, register the callout.
if (onDuty)
{
Functions.RegisterCallout(typeof(Mugging));
}
}
/// <summary>
/// Called before the plugin is unloaded.
/// </summary>
public override void Finally()
{
}
}
}