nodmzone, COMMIT NUR ZUM TESTEN
This commit is contained in:
22
ReallifeGamemode.Client/Player/position.ts
Normal file
22
ReallifeGamemode.Client/Player/position.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user