public static void ApplyMoment(Moment moment) { //World.GetNearbyVehicles(Main.PlayerPed.Position, 50f) // .Where(x => !x.IsTimeMachine()) // .ToList() // .ForEach(x => x.DeleteCompletely()); foreach (var vehicleInfo in moment.Vehicles) { Utils.SpawnFromVehicleInfo(vehicleInfo); } if (World.Weather != moment.Weather) { World.Weather = moment.Weather; } RainPuddleEditor.Level = moment.PuddleLevel; Game.Player.WantedLevel = moment.WantedLevel; }
public static Moment GetStoredMoment(DateTime currentTime, int maxHoursRange) { Moment foundMoment = null; foreach (var moment in momentsInTime) { if (moment == null) { continue; } var momentDate = moment.CurrentDate; if (currentTime >= momentDate && currentTime <= (momentDate + new TimeSpan(maxHoursRange, 0, 0))) { foundMoment = moment; break; } } return(foundMoment); }