nodmzone, COMMIT NUR ZUM TESTEN

This commit is contained in:
Fabian
2021-04-21 22:35:58 +02:00
parent 4c35539b23
commit 3edd6b5560
7 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,22 @@

export function isPlayerInNoDMZone(pos) {
if (pos.x >= -540 && pos.x <= -531
&& pos.y >= -2151 && pos.y <= -2139) {
return true;
}
return false;
}
export default function positionHandler() {
mp.events.add("checkPosition", (targetEntity) => {
if (isPlayerInNoDMZone(mp.players.local.position) || isPlayerInNoDMZone(targetEntity.position)) {
mp.gui.chat.push("Kein DM in NODM!");
}
});
setInterval(() => {
mp.events.call('toggleNoDmZone', isPlayerInNoDMZone(mp.players.local.position));
}, 200);
}