Create FishTrapResetter.cs
This commit is contained in:
commit
a17cc01bae
|
@ -0,0 +1,33 @@
|
|||
/*▄▄▄ ███▄ ▄███▓ ▄████ ▄▄▄██▀▀▀▓█████▄▄▄█████▓
|
||||
▓█████▄ ▓██▒▀█▀ ██▒ ██▒ ▀█▒ ▒██ ▓█ ▀▓ ██▒ ▓▒
|
||||
▒██▒ ▄██▓██ ▓██░▒██░▄▄▄░ ░██ ▒███ ▒ ▓██░ ▒░
|
||||
▒██░█▀ ▒██ ▒██ ░▓█ ██▓▓██▄██▓ ▒▓█ ▄░ ▓██▓ ░
|
||||
░▓█ ▀█▓▒██▒ ░██▒░▒▓███▀▒ ▓███▒ ░▒████▒ ▒██▒ ░
|
||||
░▒▓███▀▒░ ▒░ ░ ░ ░▒ ▒ ▒▓▒▒░ ░░ ▒░ ░ ▒ ░░
|
||||
▒░▒ ░ ░ ░ ░ ░ ░ ▒ ░▒░ ░ ░ ░ ░
|
||||
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
|
||||
░ ░ ░ ░ ░ ░ ░*/
|
||||
using HarmonyLib;
|
||||
using Oxide.Core.Plugins;
|
||||
namespace Oxide.Plugins
|
||||
{
|
||||
[Info("FishTrapResetter", "bmgjet", "1.0.0")]
|
||||
[Description("Resets fish traps on each catch.")]
|
||||
class FishTrapResetter : RustPlugin
|
||||
{
|
||||
[AutoPatch]
|
||||
[HarmonyPatch(typeof(WildlifeTrap), "OnTrappedWildlife", typeof(bool))]
|
||||
public static class WildlifeTrap_OnTrappedWildlife
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
public static void Postfix(WildlifeTrap __instance)
|
||||
{
|
||||
__instance.Invoke(() =>
|
||||
{
|
||||
__instance.SetTrapActive(__instance.HasBait());
|
||||
__instance.ClearTrap();
|
||||
}, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue