Implemented CanMountEntity hook (Rust)

Discussion in 'Feature Suggestions' started by k1lly0u, Sep 23, 2017.

  1. k1lly0u

    k1lly0u Grenade Master Plugin Developer

    Code (C#):

        // BaseMountable
        public void MountPlayer(BasePlayer player)
        {
            if (this._mounted != null)
            {
                return;
            }

            object[] objArray = new object[] { this, player };    
            if (Interface.CallHook("CanMountEntity", objArray) != null)
            {
                return;
            }

            player.EnsureDismounted();
            this._mounted = player;
            player.MountObject(this, 0);
            player.MovePosition(this.mountAnchor.transform.position);
            player.transform.rotation = this.mountAnchor.transform.rotation;
            player.ServerRotation = this.mountAnchor.transform.rotation;
            player.OverrideViewAngles(this.mountAnchor.transform.rotation.eulerAngles);
            this._mounted.eyes.NetworkUpdate(this.mountAnchor.transform.rotation);
            player.ClientRPCPlayer(null, player, "ForcePositionTo", player.transform.position, null, null, null, null);
            base.SetFlag(BaseEntity.Flags.Busy, true, false);
        }
     
    Last edited: Sep 23, 2017
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Implemented locally.
     
  3. ninco90

    ninco90 Scavenger

    How could this be used to sit on a chair?
     
  4. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Unless it is triggered by Rust for that entity, you can't.
     
    ninco90 likes this.