new busroute added
This commit is contained in:
@@ -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 != "") {
|
||||
|
||||
@@ -180,8 +180,6 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
}
|
||||
System.Threading.Thread.Sleep(100);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,21 @@ namespace ReallifeGamemode.Server.Job
|
||||
new Vector3(-248.9475,-883.7717,30.00919),
|
||||
}.AsReadOnly();
|
||||
|
||||
private readonly IReadOnlyCollection<Vector3> RouteLong = new List<Vector3>
|
||||
{
|
||||
|
||||
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, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user