Пример #1
0
        private void SpawnMenu_OnMenuOpen(UIMenu sender)
        {
            if (ForceNew || (Main.PlayerVehicle == null || !DeloreanHandler.IsVehicleATimeMachine(Main.PlayerVehicle)))
            {
                if (ForceNew)
                {
                    ForceNew = false;
                }

                Vector3 spawnPos = Main.PlayerPed.Position;

                if (Main.PlayerVehicle != null)
                {
                    spawnPos = Main.PlayerVehicle.Position.Around(5f);
                }

                _tempTimeMachine = (DeloreanTimeMachine)DMC12.CreateDelorean(spawnPos, Main.PlayerPed.Heading, DeloreanType.BTTF1);

                Main.PlayerPed.SetIntoVehicle(_tempTimeMachine.Vehicle, VehicleSeat.Driver);

                _tempTimeMachine.Vehicle.PlaceOnGround();

                _tempTimeMachine.MPHSpeed = 1;
            }
            else if (DeloreanHandler.IsVehicleATimeMachine(Main.PlayerVehicle))
            {
                _tempTimeMachine = DeloreanHandler.GetTimeMachineFromVehicle(Main.PlayerVehicle);
                _save            = true;

                _wheelsType.Enabled = !_tempTimeMachine.Circuits.IsFlying;
            }

            LoadVehicleType();
        }
Пример #2
0
        private void CheckForCargoVehicle()
        {
            if (IsPlayerInAnyVehicle && Vehicle.Position.DistanceTo(Main.PlayerVehicle.Position) <= 2.4f)
            {
                cargoVehicle = Main.PlayerVehicle;

                if (DeloreanHandler.IsVehicleATimeMachine(cargoVehicle))
                {
                    DeloreanHandler.GetTimeMachineFromVehicle(cargoVehicle).Circuits.GetHandler <FlyingHandler>().CanConvert = false;
                }
            }
        }
Пример #3
0
        public void Process()
        {
            //if (IsPlayerInsideVan && Game.IsControlJustPressed(GTA.Control.VehicleHandbrake))
            //    ToggleRampAnimation();

            if (doAnimation)
            {
                ProcessAnimation();
            }

            //Vehicle.Doors[VehicleDoorIndex.Trunk].AngleRatio = 0.71f;
            Vehicle.Doors[VehicleDoorIndex.Trunk].CanBeBroken = false;

            finalRamp.ProcessPropExistance();
            rampSupports.ProcessPropExistance();

            finalRamp.Prop.IsCollisionEnabled    = true;
            rampSupports.Prop.IsCollisionEnabled = true;

            if (cargoVehicle == null)
            {
                CheckForCargoVehicle();
            }
            else if (!IsCargoVehicleInside && Vehicle.Position.DistanceTo(cargoVehicle.Position) > 2.6f)
            {
                if (DeloreanHandler.IsVehicleATimeMachine(cargoVehicle))
                {
                    DeloreanHandler.GetTimeMachineFromVehicle(cargoVehicle).Circuits.GetHandler <FlyingHandler>().CanConvert = true;
                }

                cargoVehicle = null;
            }


            if (Game.IsControlJustPressed(GTA.Control.VehicleDuck))
            {
                if (IsCargoVehicleInside)
                {
                    if (IsPlayerInsideVan)
                    {
                        ToggleCargoVehicle();
                    }
                }
                else
                {
                    if (IsPlayerInsideCargo)
                    {
                        ToggleCargoVehicle();
                    }
                }
            }
        }