Ejemplo n.º 1
0
        public void Update()
        {
            if (ComponentManager.hack_Vehicle.fly)
            {
                iv.asset.GetType().GetField("_engine", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, EEngine.PLANE);
                iv.asset.GetType().GetField("_hasLockMouse", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, true);
                iv.asset.GetType().GetField("_hasSleds", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, true);
                iv.asset.GetType().GetField("_hasTraction", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, true);
                iv.asset.GetType().GetField("_lift", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, 5f);
                iv.asset.GetType().GetField("_brake", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, 32f);
                iv.asset.GetType().GetField("_steerMin", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, 8f);
                iv.asset.GetType().GetField("_steerMax", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, 32f);
                inFly = true;
            }
            else if (inFly)
            {
                iv.asset.GetType().GetField("_engine", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_Engine);
                iv.asset.GetType().GetField("_hasLockMouse", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_LockedMouse);
                iv.asset.GetType().GetField("_hasSleds", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_Sleds);
                iv.asset.GetType().GetField("_hasTraction", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_Traction);
                iv.asset.GetType().GetField("_lift", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_Lift);
                iv.asset.GetType().GetField("_brake", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_Breaks);
                iv.asset.GetType().GetField("_steerMin", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_SteerMin);
                iv.asset.GetType().GetField("_steerMax", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, backup_SteerMax);
                inFly = false;
            }

            if (ComponentManager.hack_Vehicle.speed != iv.asset.speedMax)
            {
                iv.asset.GetType().GetField("_speedMax", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv.asset, ComponentManager.hack_Vehicle.speed);
            }

            if (ComponentManager.hack_Vehicle.instantSpeed)
            {
                if (Input.GetKeyDown(ControlsSettings.up))
                {
                    if (iv.spedometer != iv.asset.speedMax)
                    {
                        iv.GetType().GetField("_speed", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv, iv.asset.speedMax);
                        iv.GetType().GetField("_spedometer", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(iv, iv.asset.speedMax);
                    }
                }
            }

            if (ComponentManager.hack_Vehicle.noclip)
            {
            }
        }