public void NotifyTrailerDetached(TruckInfo truck) { if (IsOnDestination) { DetachedOnDestination?.Invoke(truck, this); } ShowBlip(false); }
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); }
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(); }
public void NotifyTraileredBy(TruckInfo truck) { ShowBlip(true); }
private void TruckDeleted(TruckInfo truckInfo) { API.ConsoleOutput("TruckDeleted"); _trucks.Remove(truckInfo); }
private void TogglePlayerDestinationBlip(Client player, TruckInfo truck, bool showBlip) { API.TriggerClientEvent(player, ClientSetDestinationEventName, showBlip ? truck.Trailer.Destination : null); }