Beispiel #1
0
        public VehicleReplica(Vehicle vehicle, SpawnFlags spawnFlags = SpawnFlags.Default) : base(vehicle)
        {
            EngineHealth   = vehicle.EngineHealth;
            EngineRunning  = vehicle.IsEngineRunning;
            PrimaryColor   = vehicle.Mods.PrimaryColor;
            SecondaryColor = vehicle.Mods.SecondaryColor;
            Livery         = vehicle.Mods.Livery;

            RPM  = vehicle.CurrentRPM;
            Gear = vehicle.CurrentGear;

            Throttle  = vehicle.ThrottlePower;
            Brake     = vehicle.BrakePower;
            Handbrake = VehicleControl.GetHandbrake(vehicle);

            SteeringAngle = vehicle.SteeringAngle;
            Lights        = vehicle.AreLightsOn;
            Headlights    = vehicle.AreHighBeamsOn;

            RunningDirection = vehicle.RunningDirection();

            WheelsRotations    = VehicleControl.GetWheelRotations(vehicle);
            WheelsCompressions = VehicleControl.GetWheelCompressions(vehicle);

            if (spawnFlags.HasFlag(SpawnFlags.NoOccupants))
            {
                return;
            }

            Occupants = new List <PedReplica>();

            foreach (Ped x in vehicle.Occupants)
            {
                Occupants.Add(new PedReplica(x));
            }
        }