Implemented CanDismountEntity hook (Rust)

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

  1. k1lly0u

    k1lly0u Grenade Master Plugin Developer

    Code (C#):

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

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

           this._mounted.DismountObject();
           Vector3 dismountPosition =this.GetDismountPosition(player);
           this._mounted.transform.rotation=this.dismountAnchor.transform.rotation;
           this._mounted.MovePosition(dismountPosition);
           this._mounted.eyes.NetworkUpdate(this.dismountAnchor.transform.rotation);
           this._mounted.SendNetworkUpdateImmediate(false);
           this._mounted.ClientRPCPlayer(null, this._mounted, "ForcePositionTo", dismountPosition, null, null, null, null);
           this._mounted =null;
           base.SetFlag(BaseEntity.Flags.Busy, false, false);
        }
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Implemented locally as object CanDismountEnity(BaseMountable mount, BasePlayer player)