Änderung Pilot,Busfahrer und und und

This commit is contained in:
Mac_Slash
2020-05-04 22:21:07 +02:00
parent 643a9c6775
commit b61c57a2d1
8 changed files with 50 additions and 107 deletions

View File

@@ -52,7 +52,7 @@ namespace ReallifeGamemode.Server.Util
{
if (user.GetUser().JobId == 4)
{
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId.Value);
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId??-1);
if (job.GetUsersInJob().Contains(user))
{
if (!user.IsInVehicle || user.VehicleSeat != 0) return;
@@ -159,7 +159,7 @@ namespace ReallifeGamemode.Server.Util
}
if (temp.LastCheckpoint != 1)
{
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId.Value);
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId??-1);
if (job.GetUsersInJob().Contains(user))
{
if (user.GetUser().JobId == 3)
@@ -245,8 +245,15 @@ namespace ReallifeGamemode.Server.Util
if (player.GetUser().JobId == 4)
{
BusDriverJob.payWage(player, 200);
CheckPointHandle.BusCheckpoint(player);
//CheckPointHandle.BusCheckpoint(player);
BusDriverJob.BusLetzterCheckpoint(player);
if (!player.IsInVehicle || player.VehicleSeat != 0) return;
Vehicle veh = player.Vehicle;
if (!(veh.GetData<IndicatorData>("indicatorData") is IndicatorData data)) data = new IndicatorData();
data.Left = false;
data.Right = false;
veh.SetData("indicatorData", data);
NAPI.ClientEvent.TriggerClientEventForAll("SERVER:setIndicatorStatus", veh.Handle.Value, data.Left, data.Right);
}
}
//NAPI.Chat.SendChatMessageToAll($"this.list.Count() = {this.list.Count()}, checkPointsDone = {checkPointsDone}, LastCheckpoint = {LastCheckpoint}");