コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 public override void UnloadPlugin(PluginState state = PluginState.Unloaded)
 {
     Instance = null;
 }
コード例 #4
0
 public override void LoadPlugin()
 {
     Instance = this;
 }