Change vehicle taxation
see https://life-of-german.org/bugtracker/bug/60-neue-fahrzeugsteuern/ @hydrant update DB before merge with master.
This commit is contained in:
@@ -44,11 +44,31 @@ namespace ReallifeGamemode.Server.Finance
|
||||
foreach (UserVehicle uVeh in dbContext.UserVehicles.Where(u => u.UserId == user.Id))
|
||||
{
|
||||
if (uVeh.Price == null)
|
||||
{
|
||||
vehicleTaxation += 400;
|
||||
continue;
|
||||
}
|
||||
vehicleTaxation += (int)(uVeh.Price * 0.005f);
|
||||
else
|
||||
vehicleTaxation += (int)(uVeh.Price * 0.0015f);
|
||||
|
||||
int taxation = uVeh.BusinessId switch
|
||||
{
|
||||
3 => 75, ///<see cref="Business.VapidCarDealerBusiness"/>
|
||||
4 => 200, ///<see cref="Business.PremiumDeluxeMotorsportCarDealerBusiness"/>
|
||||
5 => 150, ///<see cref="Business.BoatDealerBusiness"/>
|
||||
6 => 150, ///<see cref="Business.HelicopterDealerBusiness"/>
|
||||
7 => 150, ///<see cref="Business.AirplaneDealerBusiness"/>
|
||||
8 => 50, ///<see cref="Business.BikeDealerBusiness"/>
|
||||
9 => 20, ///<see cref="Business.BeachDealerBusiness"/>
|
||||
10 => 50, ///<see cref="Business.LastTrainDealerBusiness"/>
|
||||
11 => 100, ///<see cref="Business.SUVDealerBusiness"/>
|
||||
12 => 50, ///<see cref="Business.AdminDealerBusiness"/>
|
||||
13 => 100, ///<see cref="Business.ClassicAndLuxuryCarshop"/>
|
||||
14 => 200, ///<see cref="Business.OldschoolCarshop"/>
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
if (taxation is 0)
|
||||
Console.WriteLine($"[FINANCE] USER: {user.Name} ({user.Id}) has no BusinessId on UserVehicle ({uVeh.Id})");
|
||||
|
||||
vehicleTaxation += taxation;
|
||||
}
|
||||
}
|
||||
return vehicleTaxation;
|
||||
@@ -189,13 +209,13 @@ namespace ReallifeGamemode.Server.Finance
|
||||
using var dbContext = new DatabaseContext();
|
||||
foreach (var player in NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn()))
|
||||
{
|
||||
if(player.IsAfk())
|
||||
if (player.IsAfk())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
User user = player.GetUser(dbContext);
|
||||
if(user == null)
|
||||
if (user == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user