UserRollerSystem

This commit is contained in:
Mac_Slash
2020-04-21 13:27:59 +02:00
parent 15e4cec8ee
commit a2fb8c531e
3 changed files with 11 additions and 0 deletions

View File

@@ -105,6 +105,8 @@ namespace ReallifeGamemode.Database.Entities
public int PaydayTimer { get; set; } = 60; public int PaydayTimer { get; set; } = 60;
public int PlayedMinutes { get; set; } = 1;
public bool DriverLicenseVehicle { get; set; } = false; public bool DriverLicenseVehicle { get; set; } = false;
public bool FlyingLicensePlane { get; set; } = false; public bool FlyingLicensePlane { get; set; } = false;

View File

@@ -39,6 +39,14 @@ namespace ReallifeGamemode.Server.Events
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true); player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true);
return; return;
} }
else if (player.GetUser().FactionId == 0)
{
if(player.GetUser().PlayedMinutes > 1800)
{
player.SendNotification("~r~Du hast mehr als 30 Spielstunde, kaufe dir ein eigenes Fahrzeug!", true);
}
}
} }
if (vehicle.GetServerVehicle() is SchoolVehicle sVeh) if (vehicle.GetServerVehicle() is SchoolVehicle sVeh)
{ {

View File

@@ -166,6 +166,7 @@ namespace ReallifeGamemode.Server.Finance
User user = player.GetUser(dbContext); User user = player.GetUser(dbContext);
if (player.IsLoggedIn()) if (player.IsLoggedIn())
{ {
user.PlayedMinutes += 1;
if (user.PaydayTimer <= 0) if (user.PaydayTimer <= 0)
{ {
Economy.SetPaycheck(player); Economy.SetPaycheck(player);