예제 #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);
 }