-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cs
More file actions
52 lines (44 loc) · 1.49 KB
/
Main.cs
File metadata and controls
52 lines (44 loc) · 1.49 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
52
using Rocket.API;
using Rocket.Core.Logging;
using Rocket.Core.Plugins;
using Rocket.Unturned.Events;
using Rocket.Unturned.Player;
using System.Linq;
namespace HandModifier
{
public class MQSPlugin : RocketPlugin<Configuration>
{
public static MQSPlugin Instance;
protected override void Load()
{
MQSPlugin.Instance = this;
UnturnedPlayerEvents.OnPlayerUpdateGesture += GestureChange;
Logger.LogWarning("++++++++++++++++++++++++++++++++++++++");
Logger.LogWarning($"[{Name}] has been loaded! ");
Logger.LogWarning("Dev: MQS#7816");
Logger.LogWarning("Join this Discord for Support: https://discord.gg/Ssbpd9cvgp");
Logger.LogWarning("++++++++++++++++++++++++++++++++++++++");
}
private void GestureChange (UnturnedPlayer player, UnturnedPlayerEvents.PlayerGesture gesture)
{
if (gesture == UnturnedPlayerEvents.PlayerGesture.InventoryOpen)
{
{
if (player.GetPermissions().Any(x => x.Name == "modifier.ignore"))
{
return;
}
player.Inventory.items[2].resize(Configuration.Instance.Width, Configuration.Instance.Height);
}
}
}
protected override void Unload()
{
MQSPlugin.Instance = null;
UnturnedPlayerEvents.OnPlayerUpdateGesture -= GestureChange;
Logger.LogWarning("++++++++++++++++++++++++++++++++++++++");
Logger.LogWarning($"[{Name}] has been unloaded! ");
Logger.LogWarning("++++++++++++++++++++++++++++++++++++++");
}
}
}