diff --git a/ReallifeGamemode.Client/util/checkpoint.ts b/ReallifeGamemode.Client/util/checkpoint.ts index 3f53208a..e67b409f 100644 --- a/ReallifeGamemode.Client/util/checkpoint.ts +++ b/ReallifeGamemode.Client/util/checkpoint.ts @@ -35,6 +35,11 @@ export default function checkpointHandle(globalData: GlobalData) { myVar = setInterval(myTimer, 100); }); + mp.events.add('destroyCP', () => { + activeCheckpoint.destroy(); + clearInterval(myVar); + }); + function myTimer() { let dist = mp.game.gameplay.getDistanceBetweenCoords(Player.position.x, Player.position.y, 0, posCp.x, posCp.y, 0, false); //mp.gui.chat.push("delay: " + delay + " | delayCounter: " + delayCounter); @@ -49,7 +54,7 @@ export default function checkpointHandle(globalData: GlobalData) { inCheckpoint = true; if (delayCounter >= delay) { - activeCheckpoint.visible = false; + activeCheckpoint.destroy(); clearInterval(myVar); mp.events.callRemote("playerInCheckpoint"); if (event != "") { diff --git a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs index b810a62f..9e7f3524 100644 --- a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs +++ b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs @@ -180,8 +180,6 @@ namespace ReallifeGamemode.Server.DrivingSchool } System.Threading.Thread.Sleep(100); } - - } } diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index 918f3433..e7447566 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -55,6 +55,21 @@ namespace ReallifeGamemode.Server.Job new Vector3(-248.9475,-883.7717,30.00919), }.AsReadOnly(); + private readonly IReadOnlyCollection RouteLong = new List + { + + new Vector3(403.8605,-597.0284,28.1788), + new Vector3(953.7955,140.8976,80.34214), + new Vector3(1531.374,832.1884,76.94727), + new Vector3(1972.424,2643.501,45.62299), + new Vector3(1812.351,3318.685,41.64569), + new Vector3(1820.982,3700.176,33.31515), + new Vector3(2599.954,4264.15,41.87192), + new Vector3(2705.722,3308.447,55.2841), + new Vector3(355.8403,-634.835,28.56906), + + }.AsReadOnly(); + public BusDriverJob() { JobStart += BusDriverJob_JobStart; @@ -66,6 +81,7 @@ namespace ReallifeGamemode.Server.Job listRouteTexts.Add("Kurz 1"); listRouteTexts.Add("Kurz 2"); listRouteTexts.Add("Mittel 1"); + listRouteTexts.Add("Lang wie mein Lümmel"); player.TriggerEvent("showBusRouteMenu", JsonConvert.SerializeObject(listRouteTexts)); } @@ -82,6 +98,9 @@ namespace ReallifeGamemode.Server.Job } else if (type == "Mittel 1") { CheckPointHandle.StartCheckPointRoute(player, Route3, 3000, 1, ""); + } else if (type == "Lang wie mein Lümmel") + { + CheckPointHandle.StartCheckPointRoute(player, RouteLong, 3000, 1, ""); } } diff --git a/ReallifeGamemode.Server/Util/CheckPointHandle.cs b/ReallifeGamemode.Server/Util/CheckPointHandle.cs index ee476e41..d264d8b9 100644 --- a/ReallifeGamemode.Server/Util/CheckPointHandle.cs +++ b/ReallifeGamemode.Server/Util/CheckPointHandle.cs @@ -79,6 +79,7 @@ namespace ReallifeGamemode.Server.Util if (this.list.Count() == checkPointsDone) { ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!"); + CheckPointHandle.RemovePlayerHandlerFromList(this.player); } }