/*▄▄▄ ███▄ ▄███▓ ▄████ ▄▄▄██▀▀▀▓█████▄▄▄█████▓ ▓█████▄ ▓██▒▀█▀ ██▒ ██▒ ▀█▒ ▒██ ▓█ ▀▓ ██▒ ▓▒ ▒██▒ ▄██▓██ ▓██░▒██░▄▄▄░ ░██ ▒███ ▒ ▓██░ ▒░ ▒██░█▀ ▒██ ▒██ ░▓█ ██▓▓██▄██▓ ▒▓█ ▄░ ▓██▓ ░ ░▓█ ▀█▓▒██▒ ░██▒░▒▓███▀▒ ▓███▒ ░▒████▒ ▒██▒ ░ ░▒▓███▀▒░ ▒░ ░ ░ ░▒ ▒ ▒▓▒▒░ ░░ ▒░ ░ ▒ ░░ ▒░▒ ░ ░ ░ ░ ░ ░ ▒ ░▒░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░*/ using UnityEngine; namespace Oxide.Plugins { [Info("CannonRotate", "bmgjet", "1.0.0")] [Description("Rotate cannons with hammer by hold reload key and hitting")] public class CannonRotate : RustPlugin { object OnHammerHit(BasePlayer ownerPlayer, HitInfo info) { BasePlayer player = info?.Initiator as BasePlayer; if (player == null || !(player.GetParentEntity() is PlayerBoat tb)) { return null; } //Check has reload down and permission if (player.serverInput.IsDown(BUTTON.RELOAD) && info.HitEntity is Cannon cannon) { if (tb.IsAuthedForBuilding(player) && cannon?.GetParentEntity() == tb) { cannon.transform.localRotation *= Quaternion.Euler(0, 15, 0); cannon.SendNetworkUpdateImmediate(); return true; } } return null; } } }