Busfahrer und PilotenSystem überarbeitet, LoginAmbiente eingefügt, Überarbeitung der Türen
This commit is contained in:
@@ -180,7 +180,10 @@ namespace ReallifeGamemode.Server.Events
|
||||
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 == 3));
|
||||
ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
|
||||
|
||||
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.5);
|
||||
|
||||
|
||||
if (nearestDuty != null)// Duty Point
|
||||
{
|
||||
@@ -259,6 +262,62 @@ namespace ReallifeGamemode.Server.Events
|
||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
||||
}
|
||||
}
|
||||
if (nearestJobPoint != null)
|
||||
{
|
||||
Job.JobBase job = JobManager.GetJob(player.GetUser().JobId.Value);
|
||||
JobManager jobb = new JobManager();
|
||||
if (nearestJobPoint.jobId != 3 && nearestJobPoint.jobId == player.GetUser().JobId)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StopJob(player);
|
||||
return;
|
||||
}
|
||||
if (!job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StartJobEvent(player);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
|
||||
{
|
||||
if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill < 300)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StopJob(player);
|
||||
user.SetData("PilotenBase2", false);
|
||||
return;
|
||||
}
|
||||
if (!job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StartJobEvent(player);
|
||||
user.SetData("PilotenBase2", false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StopJob(player);
|
||||
user.SetData("PilotenBase2", false);
|
||||
return;
|
||||
}
|
||||
if (!job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StartJobEvent(player);
|
||||
user.SetData("PilotenBase2", true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nearestWeapon != null) // Weapon Point
|
||||
{
|
||||
|
||||
@@ -505,55 +564,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
else if (sV is JobVehicle jV)
|
||||
{
|
||||
//if (jV.GetJob().GetUsersInJob().Contains(player))
|
||||
if (u.IsAdmin(AdminLevel.ADMIN3) && player.IsAdminDuty())
|
||||
{
|
||||
}
|
||||
else if (jV.GetJob().Id == u.JobId)
|
||||
if (jV.JobId == player.GetUser().JobId)
|
||||
{
|
||||
if (!jV.GetJob().GetUsersInJob().Contains(player))
|
||||
{
|
||||
if (u.JobId == 3)
|
||||
{
|
||||
if (v.Model == (uint)Types.VehicleModel.Cuban800)
|
||||
{
|
||||
}
|
||||
if (v.Model == (uint)Types.VehicleModel.Velum || v.Model == (uint)Types.VehicleModel.Velum2)
|
||||
{
|
||||
if (u.PilotSkill < 300)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(2) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (u.JobId == 4)
|
||||
{
|
||||
if (v.Model == (uint)Types.VehicleModel.Coach)
|
||||
{
|
||||
if (u.BusSkill < 300)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(2) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
if (v.Model == (uint)Types.VehicleModel.Tourbus)
|
||||
{
|
||||
if (u.BusSkill < 800)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(3) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
player.SendNotification("~y~[JOB] ~w~Du musst den Job vorher starten!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user