Improvements based on suggestions

This commit is contained in:
Lukas Moungos
2019-11-01 20:43:46 +01:00
parent fbca9ba8e1
commit 50f1a90f58
5 changed files with 55 additions and 25 deletions

View File

@@ -47,9 +47,13 @@ export default function checkpointHandle(globalData: GlobalData) {
});
mp.events.add('destroyCP', () => {
activeCheckpoint.destroy();
activeBlip.destroy();
clearInterval(myVar);
if (activeCheckpoint != null) {
activeCheckpoint.destroy();
activeBlip.destroy();
clearInterval(myVar);
activeBlip = null;
activeCheckpoint = null;
}
});
function myTimer() {
@@ -70,6 +74,8 @@ export default function checkpointHandle(globalData: GlobalData) {
if (delayCounter >= delay) {
activeCheckpoint.destroy();
activeBlip.destroy();
activeBlip = null;
activeCheckpoint = null;
clearInterval(myVar);
mp.events.callRemote("playerInCheckpoint");
if (event != "") {