22 lines
583 B
TypeScript
22 lines
583 B
TypeScript
|
|
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);
|
|
} |