next fix taxifahrer

This commit is contained in:
Michael
2020-07-15 16:28:44 +02:00
parent 8001be2aa2
commit b076b601b3

View File

@@ -397,10 +397,12 @@ namespace ReallifeGamemode.Server.Managers
driver.SetData<bool>("hasPassager", true); driver.SetData<bool>("hasPassager", true);
using (var dbContext = new DatabaseContext()) using (var dbContext = new DatabaseContext())
{ {
int amount = (int)Math.Round(km * taxiPrice);
User contractUser = player.GetUser(dbContext); User contractUser = player.GetUser(dbContext);
contractUser.Handmoney -= (int)Math.Round(km * taxiPrice); contractUser.Handmoney -= amount;
driver.GetUser(dbContext).Wage += amount;
dbContext.SaveChanges(); dbContext.SaveChanges();
contractUser.Player.TriggerEvent("SERVER:SET_HANDMONEY", contractUser.Handmoney); //contractUser.Player.TriggerEvent("SERVER:SET_HANDMONEY", contractUser.Handmoney);
} }
player.TriggerEvent("CLIENT:startCustomerFare", taxiPrice, km); player.TriggerEvent("CLIENT:startCustomerFare", taxiPrice, km);