-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.cs
48 lines (40 loc) · 1.33 KB
/
Plugin.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
using System;
using Exiled.API.Enums;
using Exiled.API.Features;
using ExEvents = Exiled.Events.Handlers;
using Player = Smelly096.Handlers.Player;
namespace Smelly096
{
internal class Plugin : Plugin<Config>
{
public override string Name { get; } = "Smelly096";
public override string Author { get; } = "x3rt";
public override Version Version { get; } = new Version(1, 0, 1);
public override Version RequiredExiledVersion { get; } = new Version(3, 0, 0);
internal static Config SharedConfig { get; set; }
public override PluginPriority Priority => PluginPriority.Last;
private Player _player;
public override void OnEnabled()
{
if (SharedConfig is null)
SharedConfig = Config;
RegisterEvents();
base.OnEnabled();
}
public override void OnDisabled()
{
UnregisterEvents();
base.OnDisabled();
}
private void RegisterEvents()
{
_player = new Player();
ExEvents.Scp096.CalmingDown += Player.OnCalmingDownEvent;
}
private void UnregisterEvents()
{
ExEvents.Scp096.CalmingDown -= Player.OnCalmingDownEvent;
_player = null;
}
}
}