public static void askEquip(CSteamID steamID, byte page, byte x, byte y, byte[] hash) { UnturnedPlayer player = UnturnedPlayer.FromCSteamID(steamID); if (Player.instance.channel.checkOwner(steamID) && Provider.isServer && GunPermissionPlugin.CanEquip(player)) { player.Player.equipment.tryEquip(page, x, y, hash); } }
public override void LoadPlugin() { Instance = this; if (_overrided) { return; } MethodInfo originalMethod = typeof(PlayerEquipment).GetMethod("askEquip", BindingFlags.Instance | BindingFlags.Public); MethodInfo newMethod = typeof(OverrideMethods).GetMethod("askEquip", BindingFlags.Static | BindingFlags.Public); RedirectionHelper.RedirectCalls(originalMethod, newMethod); _overrided = true; }
public override void UnloadPlugin(PluginState state = PluginState.Unloaded) { Instance = null; }
public override void LoadPlugin() { Instance = this; }