frakcar verkaufen mind. 6 cars

This commit is contained in:
hydrant
2021-04-12 20:21:45 +02:00
parent 1b9ecc14eb
commit 17079b3132

View File

@@ -516,6 +516,13 @@ namespace ReallifeGamemode.Server.Managers
return; return;
} }
var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).Count();
if(factionVehicleCount <= 6)
{
ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens 6 Fahrzeuge");
return;
}
var price = dbContext.ShopVehicles.Where(v => v.Model == factionVehicle.Model && v.Active).Select(s => new { s.Price }).FirstOrDefault(); var price = dbContext.ShopVehicles.Where(v => v.Model == factionVehicle.Model && v.Active).Select(s => new { s.Price }).FirstOrDefault();
if (price == null) if (price == null)
{ {