Пример #1
0
        public void NotifyTrailerDetached(TruckInfo truck)
        {
            if (IsOnDestination)
            {
                DetachedOnDestination?.Invoke(truck, this);
            }

            ShowBlip(false);
        }
Пример #2
0
        public TruckInfo CreateTruck(Vector3 position, float rotation)
        {
            var truckHash = _truckHashes[_random.Next(0, _truckHashes.Length)];
            var truck     = new TruckInfo(API.CreateVehicle(truckHash, position, rotation, new Color(0, 0, 0), new Color(0, 0, 0)));

            truck.Deleted += TruckDeleted;
            API.SetVehicleEngineStatus(truck.Vehicle, false);

            _trucks.Add(truck);

            return(truck);
        }
Пример #3
0
        private void TrailerDetachedOnDestination(TruckInfo truckInfo, TrailerInfo trailerInfo)
        {
            API.ConsoleOutput("TrailerDetachedOnDestination");
            var driver = truckInfo.GetDriver();

            if (driver == null)
            {
                return;
            }
            if (driver.VehicleSeat != -1)
            {
                return;
            }
            double bankmoney = double.Parse(driver.GetData("Money").ToString());
            double cash      = bankmoney + trailerInfo.Money;

            driver.SetData("Money", cash);
            API.SendPictureNotificationToPlayer(driver, "Von: Spedition Perez \n Summe: $" + trailerInfo.Money.ToString() + " - \n Bargeld: $" + cash.ToString(), "CHAR_BANK_MAZE", 1, 1, "Spedition Perez", "Zahlungseingang");
            trailerInfo.Delete();
        }
Пример #4
0
 public void NotifyTraileredBy(TruckInfo truck)
 {
     ShowBlip(true);
 }
Пример #5
0
 private void TruckDeleted(TruckInfo truckInfo)
 {
     API.ConsoleOutput("TruckDeleted");
     _trucks.Remove(truckInfo);
 }
Пример #6
0
 private void TogglePlayerDestinationBlip(Client player, TruckInfo truck, bool showBlip)
 {
     API.TriggerClientEvent(player, ClientSetDestinationEventName, showBlip ? truck.Trailer.Destination : null);
 }