Exemple #1
0
        //Called every tick
        public void Update()
        {
            if (!Global.MiscEnabled)
            {
                return;
            }

            if (!Provider.isConnected)
            {
                return;
            }

            if (Provider.clients.Count < 1)
            {
                return;
            }

            if (Player.player == null)
            {
                return;
            }

            if (Global.AllOff)
            {
                return;
            }

            //Update spy
            Hooks.askScreenshot.SpyUpd();

            //Force Third Person
            if (Global.MiscSettings.ForceThirdperson)
            {
                Provider.cameraMode = ECameraMode.BOTH;
            }

            //Force GPS
            if (Global.MiscSettings.ForceSatellite)
            {
                Provider.modeConfigData.Gameplay.Satellite = true;
            }

            //Force Compass
            if (Global.MiscSettings.ForceCompass)
            {
                Provider.modeConfigData.Gameplay.Compass = true;
            }

            //Gun update
            if (Global.MiscSettings.NoRecoilSway)
            {
                if ((Player.player?.equipment?.asset != null) && Player.player.equipment.asset is ItemGunAsset)
                {
                    UpdateFirearm((ItemGunAsset)Player.player.equipment.asset);
                }
            }

            //Bypass Timers
            if (Global.MiscSettings.BypassTimers)
            {
                Provider.modeConfigData.Gameplay.Timer_Exit = 0;
            }

            //Fast Salvage
            if (Global.MiscSettings.FastSalvage)
            {
                if (salvCheck++ > 60)
                {
                    Player.player.interact.tellSalvageTimeOverride(Provider.server, 0.4f);
                }
            }

            //Hide fog
            if (Global.MiscSettings.NoFog)
            {
                UnityEngine.RenderSettings.fog = false;
            }

            //Skin changer
            Skins.SkinUpd();
        }
        //Called every tick
        public void Update()
        {
            if (!Global.MiscEnabled)
            {
                return;
            }

            if (!Provider.isConnected)
            {
                return;
            }

            if (Provider.clients.Count < 1)
            {
                return;
            }

            if (Player.player == null)
            {
                return;
            }

            if (Global.AllOff)
            {
                return;
            }

            //Update spy
            Hooks.askScreenshot.SpyUpd();

            //Force Third Person
            if (Global.MiscSettings.ForceThirdperson)
            {
                Provider.cameraMode = ECameraMode.BOTH;
            }

            //Force GPS
            if (Global.MiscSettings.ForceSatellite)
            {
                Provider.modeConfigData.Gameplay.Satellite = true;
            }

            //Force Compass
            if (Global.MiscSettings.ForceCompass)
            {
                Provider.modeConfigData.Gameplay.Compass = true;
            }

            //Gun update
            if (Global.MiscSettings.NoRecoilSway)
            {
                if ((Player.player?.equipment?.asset != null) && Player.player.equipment.asset is ItemGunAsset)
                {
                    UpdateFirearm((ItemGunAsset)Player.player.equipment.asset);
                }
            }

            //Bypass Timers
            if (Global.MiscSettings.BypassTimers)
            {
                Provider.modeConfigData.Gameplay.Timer_Exit = 0;
            }

            //Fast Salvage
            if (Global.MiscSettings.FastSalvage)
            {
                if (salvCheck++ > 60)
                {
                    CheckSalvage();
                }
            }

            //Hide fog
            if (Global.MiscSettings.NoFog)
            {
                MainCamera.instance.GetComponent <GlobalFog2>().enabled = false;
            }

            //Skin changer
            Skins.SkinUpd();

            if (Global.MiscSettings.Jesus)
            {
                Player.player.movement.itemGravityMultiplier = 0f;

                if (Input.GetKey(KeyCode.W))
                {
                    Player.player.transform.position += Camera.main.transform.forward * 0.6f;
                }
                if (Input.GetKey(KeyCode.S))
                {
                    Player.player.transform.position -= Camera.main.transform.forward * 0.6f;
                }
                if (Input.GetKey(KeyCode.KeypadMinus))
                {
                    Player.player.transform.position += Camera.main.transform.up * 0.6f;
                }
                if (Input.GetKey(KeyCode.KeypadPlus))
                {
                    Player.player.transform.position -= Camera.main.transform.up * 0.6f;
                }
            }
            else if (Player.player.movement.itemGravityMultiplier == 0f)
            {
                ItemCloudAsset itemCloudAsset = Player.player.equipment.asset as ItemCloudAsset;
                Player.player.movement.itemGravityMultiplier = ((itemCloudAsset != null) ? itemCloudAsset.gravity : 1f);
            }
        }