Restric JobPlayer

This commit is contained in:
VegaZ
2021-04-17 19:33:08 +02:00
parent 735ff66fb4
commit f65284c38e
2 changed files with 13 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ using ReallifeGamemode.Server.Types;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.WeaponDeal;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Job;
namespace ReallifeGamemode.Server.Events
{
@@ -28,7 +29,7 @@ namespace ReallifeGamemode.Server.Events
if (vehicle.GetServerVehicle() is FactionVehicle veh)
{
if (!veh.GetOwners().Contains(player.GetUser().FactionId ?? 0) && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()))
if (!veh.GetOwners().Contains(player.GetUser().FactionId ?? 0) && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()) && !JobBase.GetPlayerInJob().Contains(player))
{
if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3)
{

View File

@@ -512,6 +512,11 @@ namespace ReallifeGamemode.Server.Events
player.SendNotification("~r~Im Dienst kannst du keine Kleidung kaufen", false);
return;
}
if(JobBase.GetPlayerInJob().Contains(player))
{
player.SendNotification("~r~Im aktiven Job kannst du keine Kleidung kaufen", false);
return;
}
nearestClotheShopPoint.clotheShop.LoadShopNUI(player);
}
if (nearestItemShopPoint != null)
@@ -525,6 +530,11 @@ namespace ReallifeGamemode.Server.Events
player.SendNotification("~r~Im Dienst wirst du nicht vom Friseur bedient", false);
return;
}
if (JobBase.GetPlayerInJob().Contains(player))
{
player.SendNotification("~r~Im aktiven Job wirst du nicht vom Friseur bedient", false);
return;
}
nearestFriseurPoint.friseurShop.LoadShopNUI(player);
}
if (nearestAmmunationPoint != null)