예제 #1
0
 /// <summary>
 /// Создает загруженный урожаем трейлер
 /// </summary>
 private void CreateHarvestTrailer()
 {
     foreach (var trailerInfo in FarmDataGetter.LoadedTrailers)
     {
         if (LoadedTrailers.Any(e => Vector3.Distance(e.position, trailerInfo.Position) <= 1.7))
         {
             continue;
         }
         var trailer = API.createVehicle(trailerInfo.Hash, trailerInfo.Position, trailerInfo.Rotation, 0, 0);
         trailer.setData(LOADER_FARM_TRAILER, true);
         LoadedTrailers.Add(trailer);
         NotifyTractorDrivers(trailer.position);
         break;
     }
 }
예제 #2
0
 /// <summary>
 /// Удаляет отвезенный трейлер
 /// </summary>
 public void RemoveTrailer()
 {
     LoadedTrailers = LoadedTrailers.Where(e => e.exists).ToList();
 }