OverHaul Bus and Pilot TEST
This commit is contained in:
@@ -77,88 +77,6 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SendNotification("~y~[JOB] ~w~Du musst den Job vorher starten!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*if(player.IsAdminDuty())
|
||||
{
|
||||
player.SendChatMessage("");
|
||||
}*/
|
||||
if (jV.JobId == 3 && player.GetUser().JobId == 3 && jV.GetJob().GetUsersInJob().Contains(player))
|
||||
{
|
||||
Job.PilotJob c = new Job.PilotJob();
|
||||
if ((VehicleHash)jV.Model == VehicleHash.Cuban800 && !state)
|
||||
{
|
||||
if (!player.HasData("HatRoute") || player.GetData<bool>("HatRoute") == false)
|
||||
{
|
||||
player.SetData("HatRoute", true);
|
||||
c.StartPilotRoute(player, "RouteStart");
|
||||
}
|
||||
}
|
||||
if ((VehicleHash)jV.Model == VehicleHash.Velum && !state || (VehicleHash)jV.Model == VehicleHash.Velum2 && !state)
|
||||
{
|
||||
if (player.GetUser().PilotSkill >= 300)
|
||||
{
|
||||
if (!player.HasData("HatRoute") || player.GetData<bool>("HatRoute") == false)
|
||||
{
|
||||
player.SetData("HatRoute", true);
|
||||
c.StartPilotRoute(player, "RouteStart");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~y~[JOB] ~r~Du besitzt nicht das nötige Skilllevel(2) ");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jV.JobId == 4 && player.GetUser().JobId == 4 && jV.GetJob().GetUsersInJob().Contains(player))
|
||||
{
|
||||
Job.BusDriverJob c = new Job.BusDriverJob();
|
||||
if ((VehicleHash)jV.Model == VehicleHash.Bus && !state)
|
||||
{
|
||||
if (!player.HasData("HatRoute") || player.GetData<bool>("HatRoute") == false)
|
||||
{
|
||||
player.SetData("HatRoute", true);
|
||||
c.StartBusRoute(player, "RouteStart");
|
||||
player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45);
|
||||
}
|
||||
}
|
||||
if ((VehicleHash)jV.Model == VehicleHash.Coach && !state)
|
||||
{
|
||||
if (player.GetUser().BusSkill >= 300)
|
||||
{
|
||||
if (!player.HasData("HatRoute") || player.GetData<bool>("HatRoute") == false)
|
||||
{
|
||||
player.SetData("HatRoute", true);
|
||||
c.StartBusRoute(player, "RouteStart");
|
||||
player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~y~[JOB] ~r~Du besitzt nicht das nötige Skilllevel(2) ");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((VehicleHash)jV.Model == VehicleHash.Tourbus && !state)
|
||||
{
|
||||
if (player.GetUser().BusSkill >= 800)
|
||||
{
|
||||
if (!player.HasData("HatRoute") || player.GetData<bool>("HatRoute") == false)
|
||||
{
|
||||
player.SetData("HatRoute", true);
|
||||
c.StartBusRoute(player, "RouteStart");
|
||||
player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~y~[JOB] ~r~Du besitzt nicht das nötige Skilllevel(3) ");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sV is UserVehicle uV)
|
||||
@@ -170,7 +88,6 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
VehicleStreaming.SetEngineState(v, !state);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,8 +144,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
ServerVehicle carlocked = v.GetServerVehicle(dbContext);
|
||||
|
||||
if(state == true)
|
||||
{
|
||||
if (state == true)
|
||||
{
|
||||
carlocked.Locked = true;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
@@ -238,7 +155,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
player.SendNotification(msg);
|
||||
player.SendNotification(msg);
|
||||
}
|
||||
else if (!player.IsInVehicle)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user