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);
});
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 != "") {