Duty-Restriktionen /Klamotten /FS /Job

This commit is contained in:
VegaZ
2021-04-17 17:16:10 +02:00
parent 5e25a4d8a5
commit 9ee382d317
2 changed files with 17 additions and 1 deletions

View File

@@ -99,7 +99,11 @@ namespace ReallifeGamemode.Server.DrivingSchool
private static void EntityEnterBusinessColShape(ColShape colShape, Player client)
{
if (client.IsInVehicle || !client.IsLoggedIn()) return;
if (client.GetData<bool>("duty") == true)
{
client.SendNotification("~r~Im Dienst kannst du keinen Führerschein machen", false);
return;
}
client.TriggerEvent("drivingSchoolMenu");
}
@@ -112,11 +116,13 @@ namespace ReallifeGamemode.Server.DrivingSchool
public void StartDrivingSchool(Player client)
{
User user = client.GetUser();
if (user.DriverLicenseVehicle || client.HasData("ActiveSchool"))
{
client.SendChatMessage("~b~[INFO]~s~ Du besitzt schon einen Führerschein.");
return;
}
if (user.Handmoney < 2500)
{
client.SendNotification("~r~[FEHLER]~s~ Du hast nicht genug Geld auf der Hand($2.500)!", true);

View File

@@ -507,6 +507,11 @@ namespace ReallifeGamemode.Server.Events
}
if (nearestClotheShopPoint != null)
{
if (player.GetData<bool>("duty") == true)
{
player.SendNotification("~r~Im Dienst kannst du keine Kleidung kaufen", false);
return;
}
nearestClotheShopPoint.clotheShop.LoadShopNUI(player);
}
if (nearestItemShopPoint != null)
@@ -547,6 +552,11 @@ namespace ReallifeGamemode.Server.Events
}
if (!job.GetUsersInJob().Contains(player))
{
if (player.GetData<bool>("duty") == true)
{
player.SendNotification("~r~Im Dienst kannst du keinen Job ausführen", false);
return;
}
if (player.GetUser().JobId == 3)
{
if (nearestJobPoint.Skill > user.PilotSkill)