private void NoRecoil()
        {
            if (!CVars.Misc.NoRecoil)
            {
                return;
            }
            HumanController localController     = HackLocal.LocalController;
            InventoryItem   currentEquippedItem = HackLocal.GetCurrentEquippedItem(localController);

            if (currentEquippedItem != null && !(currentEquippedItem is MeleeWeaponItem <MeleeWeaponDataBlock>))
            {
                BulletWeaponItem <BulletWeaponDataBlock> bulletWeaponItem = currentEquippedItem as BulletWeaponItem <BulletWeaponDataBlock>;
                if (bulletWeaponItem != null)
                {
                    bulletWeaponItem.datablock.bulletRange    = 300f;
                    bulletWeaponItem.datablock.recoilPitchMin = 0f;
                    bulletWeaponItem.datablock.recoilPitchMax = 0f;
                    bulletWeaponItem.datablock.recoilYawMin   = 0f;
                    bulletWeaponItem.datablock.recoilYawMax   = 0f;
                    bulletWeaponItem.datablock.aimSway        = 0f;
                    bulletWeaponItem.datablock.aimSwaySpeed   = 0f;
                }
            }
            CameraMount componentInChildren = localController.GetComponentInChildren <CameraMount>();

            if (componentInChildren != null)
            {
                HeadBob component = componentInChildren.GetComponent <HeadBob>();
                if (component != null)
                {
                    component.aimRotationScalar       = 0f;
                    component.viewModelRotationScalar = 0f;
                }
            }
        }
Example #2
0
    private void SetLocalOnlyComponentsEnabled(bool enable)
    {
        CCMotor component = base.GetComponent <CCMotor>();

        if (component)
        {
            component.enabled = enable;
            CharacterController characterController = base.collider as CharacterController;
            if (characterController)
            {
                characterController.enabled = enable;
            }
        }
        CameraMount componentInChildren = base.GetComponentInChildren <CameraMount>();

        if (componentInChildren)
        {
            componentInChildren.open = enable;
            HeadBob headBob = componentInChildren.GetComponent <HeadBob>();
            if (headBob)
            {
                headBob.enabled = enable;
            }
            LazyCam lazyCam = componentInChildren.GetComponent <LazyCam>();
            if (lazyCam)
            {
                lazyCam.enabled = enable;
            }
        }
        LocalDamageDisplay localDamageDisplay = base.GetComponent <LocalDamageDisplay>();

        if (localDamageDisplay)
        {
            localDamageDisplay.enabled = enable;
        }
    }
Example #3
0
    private void SetLocalOnlyComponentsEnabled(bool enable)
    {
        CCMotor component = base.GetComponent <CCMotor>();

        if (component != null)
        {
            component.enabled = enable;
            CharacterController collider = base.collider as CharacterController;
            if (collider != null)
            {
                collider.enabled = enable;
            }
        }
        CameraMount componentInChildren = base.GetComponentInChildren <CameraMount>();

        if (componentInChildren != null)
        {
            componentInChildren.open = enable;
            HeadBob bob = componentInChildren.GetComponent <HeadBob>();
            if (bob != null)
            {
                bob.enabled = enable;
            }
            LazyCam cam = componentInChildren.GetComponent <LazyCam>();
            if (cam != null)
            {
                cam.enabled = enable;
            }
        }
        LocalDamageDisplay display = base.GetComponent <LocalDamageDisplay>();

        if (display != null)
        {
            display.enabled = enable;
        }
    }
Example #4
0
        // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
        public void OnGUI()
        {
            bool flag = !PlayerClient.GetLocalPlayer() || !PlayerClient.GetLocalPlayer().controllable;

            if (flag)
            {
                ZoomGUIRustNoWipe.onlytimemsg    = true;
                ZoomGUIRustNoWipe.levelzoom      = 60f;
                ZoomGUIRustNoWipe.counterseconds = 10f;
                Zoom.On = false;
            }
            else
            {
                bool flag2 = !Zoom.On && ZoomGUIRustNoWipe.counterseconds >= 0f;
                if (flag2)
                {
                    GUI.DrawTexture(new Rect(600f, 200f, 116f, 54f), ZoomGUIRustNoWipe.Messagy, ScaleMode.StretchToFill);
                    ZoomGUIRustNoWipe.counterseconds -= Time.deltaTime;
                }
                else
                {
                    bool flag3 = !Zoom.On && ZoomGUIRustNoWipe.onlytimemsg;
                    if (flag3)
                    {
                        ZoomGUIRustNoWipe.onlytimemsg = false;
                    }
                    else
                    {
                        bool flag4 = PlayerClient.GetLocalPlayer() || (PlayerClient.GetLocalPlayer().controllable&& Zoom.On);
                        if (flag4)
                        {
                            ZoomGUIRustNoWipe.mouse0 = false;
                            ZoomGUIRustNoWipe.mouse1 = false;
                            bool key = Input.GetKey(KeyCode.Mouse0);
                            if (key)
                            {
                                ZoomGUIRustNoWipe.mouse1 = true;
                            }
                            bool key2 = Input.GetKey(KeyCode.Mouse1);
                            if (key2)
                            {
                                ZoomGUIRustNoWipe.mouse0 = true;
                            }
                            bool keyUp = Input.GetKeyUp(KeyCode.Mouse0);
                            if (keyUp)
                            {
                                ZoomGUIRustNoWipe.mouse1 = false;
                            }
                            bool keyUp2 = Input.GetKeyUp(KeyCode.Mouse1);
                            if (keyUp2)
                            {
                                ZoomGUIRustNoWipe.mouse0 = false;
                            }
                        }
                        bool flag5 = ZoomGUIRustNoWipe.mouse1 && !ZoomGUIRustNoWipe.mouse0 && Zoom.On;
                        if (flag5)
                        {
                            Inventory component = PlayerClient.GetLocalPlayer().controllable.GetComponent <Inventory>();
                            this.ClearWeapon(component);
                            bool flag6 = ZoomGUIRustNoWipe.levelzoom > 60f;
                            if (flag6)
                            {
                                ZoomGUIRustNoWipe.levelzoom = 60f;
                            }
                            bool flag7 = ZoomGUIRustNoWipe.levelzoom < 0f;
                            if (flag7)
                            {
                                ZoomGUIRustNoWipe.levelzoom = 0f;
                            }
                            bool flag8 = ZoomGUIRustNoWipe.levelzoom >= 20f;
                            if (flag8)
                            {
                                ZoomGUIRustNoWipe.levelzoom = ZoomGUIRustNoWipe.levelzoom - Time.deltaTime - 0.3f;
                            }
                            bool flag9 = ZoomGUIRustNoWipe.levelzoom < 20f;
                            if (flag9)
                            {
                                ZoomGUIRustNoWipe.levelzoom = ZoomGUIRustNoWipe.levelzoom - Time.deltaTime - 0.05f;
                            }
                            bool flag10 = ZoomGUIRustNoWipe.levelzoom > 0f;
                            if (flag10)
                            {
                                HumanController component2          = PlayerClient.GetLocalPlayer().controllable.GetComponent <HumanController>();
                                CameraMount     componentInChildren = component2.GetComponentInChildren <CameraMount>();
                                bool            flag11 = componentInChildren != null;
                                if (flag11)
                                {
                                    HeadBob component3 = componentInChildren.GetComponent <HeadBob>();
                                    bool    flag12     = component3 != null;
                                    if (flag12)
                                    {
                                        CameraFX mainCameraFX = CameraFX.mainCameraFX;
                                        bool     flag13       = mainCameraFX != null;
                                        if (flag13)
                                        {
                                            mainCameraFX.SetFieldOfView(ZoomGUIRustNoWipe.levelzoom, 1f);
                                        }
                                    }
                                }
                            }
                        }
                        bool flag14 = ZoomGUIRustNoWipe.mouse0 && !ZoomGUIRustNoWipe.mouse1 && Zoom.On;
                        if (flag14)
                        {
                            Inventory component4 = PlayerClient.GetLocalPlayer().controllable.GetComponent <Inventory>();
                            this.ClearWeapon(component4);
                            bool flag15 = ZoomGUIRustNoWipe.levelzoom > 60f;
                            if (flag15)
                            {
                                ZoomGUIRustNoWipe.levelzoom = 60f;
                            }
                            bool flag16 = ZoomGUIRustNoWipe.levelzoom < 0f;
                            if (flag16)
                            {
                                ZoomGUIRustNoWipe.levelzoom = 0f;
                            }
                            bool flag17 = ZoomGUIRustNoWipe.levelzoom >= 20f;
                            if (flag17)
                            {
                                ZoomGUIRustNoWipe.levelzoom = ZoomGUIRustNoWipe.levelzoom + Time.deltaTime + 0.3f;
                            }
                            bool flag18 = ZoomGUIRustNoWipe.levelzoom < 20f;
                            if (flag18)
                            {
                                ZoomGUIRustNoWipe.levelzoom = ZoomGUIRustNoWipe.levelzoom + Time.deltaTime + 0.05f;
                            }
                            bool flag19 = ZoomGUIRustNoWipe.levelzoom > 0f;
                            if (flag19)
                            {
                                HumanController component5           = PlayerClient.GetLocalPlayer().controllable.GetComponent <HumanController>();
                                CameraMount     componentInChildren2 = component5.GetComponentInChildren <CameraMount>();
                                bool            flag20 = componentInChildren2 != null;
                                if (flag20)
                                {
                                    HeadBob component6 = componentInChildren2.GetComponent <HeadBob>();
                                    bool    flag21     = component6 != null;
                                    if (flag21)
                                    {
                                        CameraFX mainCameraFX2 = CameraFX.mainCameraFX;
                                        bool     flag22        = mainCameraFX2 != null;
                                        if (flag22)
                                        {
                                            mainCameraFX2.SetFieldOfView(ZoomGUIRustNoWipe.levelzoom, 1f);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Example #5
0
        private void NoRecoil()
        {
            if (CVars.Misc.NoRecoil)
            {
                HumanController localController     = ESP_UpdateOBJs.LocalController;
                InventoryItem   currentEquippedItem = Local.GetCurrentEquippedItem(localController);
                if ((currentEquippedItem != null) && !(currentEquippedItem is MeleeWeaponItem <MeleeWeaponDataBlock>))
                {
                    BulletWeaponItem <BulletWeaponDataBlock> item2 = currentEquippedItem as BulletWeaponItem <BulletWeaponDataBlock>;
                    if (item2 != null)
                    {
                        defaultBulletRange    = item2.datablock.bulletRange;
                        defaultRecoilPitchMin = item2.datablock.recoilPitchMin;
                        defaultRecoilPitchMax = item2.datablock.recoilPitchMax;
                        defaultRecoilYawMin   = item2.datablock.recoilYawMin;
                        defaultRecoilYawMax   = item2.datablock.recoilYawMax;
                        defaultAimSway        = item2.datablock.aimSway;
                        defaultAimSwaySpeed   = item2.datablock.aimSwaySpeed;

                        //item2.datablock.bulletRange = 300f;
                        item2.datablock.recoilPitchMin = 0f;
                        item2.datablock.recoilPitchMax = 0f;
                        item2.datablock.recoilYawMin   = 0f;
                        item2.datablock.recoilYawMax   = 0f;
                        item2.datablock.aimSway        = 0f;
                        item2.datablock.aimSwaySpeed   = 0f;
                    }
                }
                CameraMount componentInChildren = localController.GetComponentInChildren <CameraMount>();
                if (componentInChildren != null)
                {
                    HeadBob component = componentInChildren.GetComponent <HeadBob>();
                    if (component != null)
                    {
                        defaultAimRotationScalar          = component.aimRotationScalar;
                        defaultViewModelRotationScalar    = component.viewModelRotationScalar;
                        component.aimRotationScalar       = 0f;
                        component.viewModelRotationScalar = 0f;
                    }
                }
            }
            else
            {
                if (defaultBulletRange == 0f)
                {
                    HumanController localController     = ESP_UpdateOBJs.LocalController;
                    InventoryItem   currentEquippedItem = Local.GetCurrentEquippedItem(localController);
                    if ((currentEquippedItem != null) && !(currentEquippedItem is MeleeWeaponItem <MeleeWeaponDataBlock>))
                    {
                        BulletWeaponItem <BulletWeaponDataBlock> item2 = currentEquippedItem as BulletWeaponItem <BulletWeaponDataBlock>;
                        if (item2 != null)
                        {
                            defaultBulletRange    = item2.datablock.bulletRange;
                            defaultRecoilPitchMin = item2.datablock.recoilPitchMin;
                            defaultRecoilPitchMax = item2.datablock.recoilPitchMax;
                            defaultRecoilYawMin   = item2.datablock.recoilYawMin;
                            defaultRecoilYawMax   = item2.datablock.recoilYawMax;
                            defaultAimSway        = item2.datablock.aimSway;
                            defaultAimSwaySpeed   = item2.datablock.aimSwaySpeed;
                        }
                    }
                    CameraMount componentInChildren = localController.GetComponentInChildren <CameraMount>();
                    if (componentInChildren != null)
                    {
                        HeadBob component = componentInChildren.GetComponent <HeadBob>();
                        if (component != null)
                        {
                            defaultAimRotationScalar       = component.aimRotationScalar;
                            defaultViewModelRotationScalar = component.viewModelRotationScalar;
                        }
                    }
                }
                else
                {
                    HumanController localController     = ESP_UpdateOBJs.LocalController;
                    InventoryItem   currentEquippedItem = Local.GetCurrentEquippedItem(localController);
                    if ((currentEquippedItem != null) && !(currentEquippedItem is MeleeWeaponItem <MeleeWeaponDataBlock>))
                    {
                        BulletWeaponItem <BulletWeaponDataBlock> item2 = currentEquippedItem as BulletWeaponItem <BulletWeaponDataBlock>;
                        if (item2 != null)
                        {
                            //item2.datablock.bulletRange = defaultBulletRange;
                            item2.datablock.recoilPitchMin = defaultRecoilPitchMin;
                            item2.datablock.recoilPitchMax = defaultRecoilPitchMax;
                            item2.datablock.recoilYawMin   = defaultRecoilYawMin;
                            item2.datablock.recoilYawMax   = defaultRecoilYawMax;
                            item2.datablock.aimSway        = defaultAimSway;
                            item2.datablock.aimSwaySpeed   = defaultAimSwaySpeed;
                        }
                    }
                    CameraMount componentInChildren = localController.GetComponentInChildren <CameraMount>();
                    if (componentInChildren != null)
                    {
                        HeadBob component = componentInChildren.GetComponent <HeadBob>();
                        if (component != null)
                        {
                            component.aimRotationScalar       = defaultAimRotationScalar;
                            component.viewModelRotationScalar = defaultViewModelRotationScalar;
                        }
                    }
                }
            }
        }