May 2025 update

Hello. This needs an update

05/01 14:11:24 | 1. 'RidableHorse' does not contain a definition for 'currentSpeed' and no accessible extension method 'currentSpeed' accepting a first argument of type 'RidableHorse' could be found (are you missing a using directive or an assembly reference?) [CS1061]
(WhoaBoy 23 line 22)
05/01 14:11:24 | 2. The name 'BaseRidableAnimal' does not exist in the current context [CS0103]
(WhoaBoy 75 line 24)

Same here...

Merged post

See if this works...

using UnityEngine;
using Oxide.Core;
using Oxide.Core.Plugins;

namespace Oxide.Plugins
{
    [Info("Whoa Boy", "Clearshot", "1.1.0")]
    [Description("Stop horses from running away when you dismount")]
    class WhoaBoy : CovalencePlugin
    {
        private PluginConfig _config;

        private void Init()
        {
            permission.RegisterPermission("whoaboy.use", this);
        }

        void OnEntityDismounted(BaseVehicleSeat seat, BasePlayer player)
        {
            if (_config.usePermission && player != null && !permission.UserHasPermission(player.UserIDString, "whoaboy.use")) return;
            if (seat == null) return;

            RidableHorse horse = seat.GetParentEntity() as RidableHorse;
            if (horse == null) return;

            // Get current speed from rigidbody
            float currentSpeed = horse.rigidBody.velocity.magnitude;

            if (currentSpeed > 4f)
            {
                // Use the gait system to control movement
                if (_config.stopType.Contains("stop"))
                {
                    horse.currentGait = RidableHorse.GaitType.Walk;
                    horse.rigidBody.velocity = Vector3.zero;
                }
                else
                {
                    horse.currentGait = RidableHorse.GaitType.Walk;
                }

                if (_config.stopType == "stopAndStand" && horse.CanStand())
                    horse.ClientRPC(null, "Stand");
            }
            else
            {
                horse.currentGait = RidableHorse.GaitType.Walk;
                horse.rigidBody.velocity = Vector3.zero;
            }

            // Reset rotation if needed
            horse.rigidBody.angularVelocity = Vector3.zero;
        }

        #region Config

        protected override void LoadDefaultConfig()
        {
            Config.WriteObject(GetDefaultConfig(), true);
        }

        private PluginConfig GetDefaultConfig()
        {
            return new PluginConfig();
        }

        protected override void LoadConfig()
        {
            base.LoadConfig();
            _config = Config.ReadObject<PluginConfig>();
        }

        private class PluginConfig
        {
            public bool usePermission = false;
            public string stopType = "stop";
        }

        #endregion
    }
}