diff --git a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs index 7c59d03d..73b06218 100644 --- a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs +++ b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs @@ -98,8 +98,9 @@ namespace ReallifeGamemode.Server.DrivingSchool private static void EntityEnterBusinessColShape(ColShape colShape, Player client) { + var user = client.GetUser(); if (client.IsInVehicle || !client.IsLoggedIn()) return; - if (client.GetData("duty") == true) + if (user.GetData("duty")) { client.SendNotification("~r~Im Dienst kannst du keinen Führerschein machen", false); return; diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 0fbef061..3155ed33 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -230,8 +230,8 @@ namespace ReallifeGamemode.Server.Events WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId); JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData("duty")); ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 2 || user.FactionId == 3)); - ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData("duty"))); - FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData("duty"))); + ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); + FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6); Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData("duty")); @@ -507,7 +507,7 @@ namespace ReallifeGamemode.Server.Events } if (nearestClotheShopPoint != null) { - if (player.GetData("duty") == true) + if (user.GetData("duty")) { player.SendNotification("~r~Im Dienst kannst du keine Kleidung kaufen", false); return; @@ -520,6 +520,11 @@ namespace ReallifeGamemode.Server.Events } if (nearestFriseurPoint != null) { + if (user.GetData("duty")) + { + player.SendNotification("~r~Im Dienst wirst du nicht vom Friseur bedient", false); + return; + } nearestFriseurPoint.friseurShop.LoadShopNUI(player); } if (nearestAmmunationPoint != null) @@ -552,7 +557,7 @@ namespace ReallifeGamemode.Server.Events } if (!job.GetUsersInJob().Contains(player)) { - if (player.GetData("duty") == true) + if (user.GetData("duty")) { player.SendNotification("~r~Im Dienst kannst du keinen Job ausführen", false); return;