testings
This commit is contained in:
@@ -378,16 +378,24 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
colShape.OnEntityEnterColShape += (cs, c) =>
|
||||
{
|
||||
if (!c.IsInVehicle) return;
|
||||
if (!(c.IsInVehicle && c.VehicleSeat == 0)) return;
|
||||
|
||||
c.TriggerEvent("washcar");
|
||||
|
||||
using (var dbcontext = new DatabaseContext())
|
||||
{
|
||||
User u = c.GetUser(dbcontext);
|
||||
u.BankAccount.Balance -= 100;
|
||||
dbcontext.SaveChanges();
|
||||
if(u.Handmoney <= 0)
|
||||
{
|
||||
c.SendNotification("Du hast nicht genug Geld auf der Hand!");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
c.TriggerEvent("washcar");
|
||||
c.SendNotification("Die Autowäsche hat dich ~g~$~w~100 gekostet.");
|
||||
u.Handmoney -= 100;
|
||||
dbcontext.SaveChanges();
|
||||
}
|
||||
}
|
||||
c.SendNotification("Die Autowäsche hat dich ~g~$~w~100 gekostet.");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user