This commit is contained in:
@@ -98,8 +98,9 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
|||||||
|
|
||||||
private static void EntityEnterBusinessColShape(ColShape colShape, Player client)
|
private static void EntityEnterBusinessColShape(ColShape colShape, Player client)
|
||||||
{
|
{
|
||||||
|
var user = client.GetUser();
|
||||||
if (client.IsInVehicle || !client.IsLoggedIn()) return;
|
if (client.IsInVehicle || !client.IsLoggedIn()) return;
|
||||||
if (client.GetData<bool>("duty") == true)
|
if (user.GetData<bool>("duty"))
|
||||||
{
|
{
|
||||||
client.SendNotification("~r~Im Dienst kannst du keinen Führerschein machen", false);
|
client.SendNotification("~r~Im Dienst kannst du keinen Führerschein machen", false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -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);
|
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<bool>("duty"));
|
JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData<bool>("duty"));
|
||||||
ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 2 || user.FactionId == 3));
|
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<bool>("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 && (!user.GetData<bool>("duty")));
|
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);
|
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);
|
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<bool>("duty"));
|
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
|
||||||
@@ -507,7 +507,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
if (nearestClotheShopPoint != null)
|
if (nearestClotheShopPoint != null)
|
||||||
{
|
{
|
||||||
if (player.GetData<bool>("duty") == true)
|
if (user.GetData<bool>("duty"))
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Im Dienst kannst du keine Kleidung kaufen", false);
|
player.SendNotification("~r~Im Dienst kannst du keine Kleidung kaufen", false);
|
||||||
return;
|
return;
|
||||||
@@ -520,6 +520,11 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
if (nearestFriseurPoint != null)
|
if (nearestFriseurPoint != null)
|
||||||
{
|
{
|
||||||
|
if (user.GetData<bool>("duty"))
|
||||||
|
{
|
||||||
|
player.SendNotification("~r~Im Dienst wirst du nicht vom Friseur bedient", false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
nearestFriseurPoint.friseurShop.LoadShopNUI(player);
|
nearestFriseurPoint.friseurShop.LoadShopNUI(player);
|
||||||
}
|
}
|
||||||
if (nearestAmmunationPoint != null)
|
if (nearestAmmunationPoint != null)
|
||||||
@@ -552,7 +557,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
if (!job.GetUsersInJob().Contains(player))
|
if (!job.GetUsersInJob().Contains(player))
|
||||||
{
|
{
|
||||||
if (player.GetData<bool>("duty") == true)
|
if (user.GetData<bool>("duty"))
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Im Dienst kannst du keinen Job ausführen", false);
|
player.SendNotification("~r~Im Dienst kannst du keinen Job ausführen", false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user