namespace Oxide.Plugins { [Info("BanHammer", "Waylvin", "1.0.0")] [Description("Ban players by hitting them with a Salvaged Hammer!")] class BanHammer : CovalencePlugin { private void Init() => permission.RegisterPermission("BanHammer.on", this); void OnMeleeAttack(BasePlayer player, HitInfo info) { if (info.Weapon.ShortPrefabName.Contains("hammer_salvaged.entity")) { BasePlayer target = info?.HitEntity.ToPlayer(); if (target != null) { if (permission.UserHasPermission(player.UserIDString, "BanHammer.on")) { server.Command($"banid {target.userID} {target.displayName} BanHammerAction"); server.Command($"say {target.displayName} has been banned by {player.displayName}"); } else { PrintError($"You were unable to ban {target.displayName}."); } } } } } }