mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
initial event draft
This commit is contained in:
1 parent
bc756d5c1b
commit
4c113e5fb8
10 files changed
+123
-32
No files matched your search
@@ -2,6 +2,8 @@
|
||||
using BepInEx.Configuration;
|
||||
using BepInEx.Unity.IL2CPP;
|
||||
using HarmonyLib;
|
||||
using MiraAPI.Events;
|
||||
using MiraAPI.Events.Vanilla;
|
||||
using MiraAPI.PluginLoading;
|
||||
using Reactor;
|
||||
using Reactor.Networking;
|
||||
@@ -21,6 +23,14 @@ public partial class ExamplePlugin : BasePlugin, IMiraPlugin
|
||||
public ConfigFile GetConfigFile() => Config;
|
||||
public override void Load()
|
||||
{
|
||||
MiraEventManager.RegisterEventHandler<BeforeMurderEvent>(
|
||||
e =>
|
||||
{
|
||||
if (e.Source.PlayerId == PlayerControl.LocalPlayer.PlayerId)
|
||||
{
|
||||
e.Cancel();
|
||||
}
|
||||
});
|
||||
Harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user