new busroute added

This commit is contained in:
2019-10-04 15:26:06 +02:00
parent 6ef6f34f11
commit 64244c7b83
4 changed files with 26 additions and 3 deletions

View File

@@ -35,6 +35,11 @@ export default function checkpointHandle(globalData: GlobalData) {
myVar = setInterval(myTimer, 100); myVar = setInterval(myTimer, 100);
}); });
mp.events.add('destroyCP', () => {
activeCheckpoint.destroy();
clearInterval(myVar);
});
function myTimer() { function myTimer() {
let dist = mp.game.gameplay.getDistanceBetweenCoords(Player.position.x, Player.position.y, 0, posCp.x, posCp.y, 0, false); 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); //mp.gui.chat.push("delay: " + delay + " | delayCounter: " + delayCounter);
@@ -49,7 +54,7 @@ export default function checkpointHandle(globalData: GlobalData) {
inCheckpoint = true; inCheckpoint = true;
if (delayCounter >= delay) { if (delayCounter >= delay) {
activeCheckpoint.visible = false; activeCheckpoint.destroy();
clearInterval(myVar); clearInterval(myVar);
mp.events.callRemote("playerInCheckpoint"); mp.events.callRemote("playerInCheckpoint");
if (event != "") { if (event != "") {

View File

@@ -180,8 +180,6 @@ namespace ReallifeGamemode.Server.DrivingSchool
} }
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(100);
} }
} }
} }

View File

@@ -55,6 +55,21 @@ namespace ReallifeGamemode.Server.Job
new Vector3(-248.9475,-883.7717,30.00919), new Vector3(-248.9475,-883.7717,30.00919),
}.AsReadOnly(); }.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() public BusDriverJob()
{ {
JobStart += BusDriverJob_JobStart; JobStart += BusDriverJob_JobStart;
@@ -66,6 +81,7 @@ namespace ReallifeGamemode.Server.Job
listRouteTexts.Add("Kurz 1"); listRouteTexts.Add("Kurz 1");
listRouteTexts.Add("Kurz 2"); listRouteTexts.Add("Kurz 2");
listRouteTexts.Add("Mittel 1"); listRouteTexts.Add("Mittel 1");
listRouteTexts.Add("Lang wie mein Lümmel");
player.TriggerEvent("showBusRouteMenu", JsonConvert.SerializeObject(listRouteTexts)); player.TriggerEvent("showBusRouteMenu", JsonConvert.SerializeObject(listRouteTexts));
} }
@@ -82,6 +98,9 @@ namespace ReallifeGamemode.Server.Job
} else if (type == "Mittel 1") } else if (type == "Mittel 1")
{ {
CheckPointHandle.StartCheckPointRoute(player, Route3, 3000, 1, ""); CheckPointHandle.StartCheckPointRoute(player, Route3, 3000, 1, "");
} else if (type == "Lang wie mein Lümmel")
{
CheckPointHandle.StartCheckPointRoute(player, RouteLong, 3000, 1, "");
} }
} }

View File

@@ -79,6 +79,7 @@ namespace ReallifeGamemode.Server.Util
if (this.list.Count() == checkPointsDone) if (this.list.Count() == checkPointsDone)
{ {
ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!"); ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!");
CheckPointHandle.RemovePlayerHandlerFromList(this.player); CheckPointHandle.RemovePlayerHandlerFromList(this.player);
} }
} }