index.js vom polygon hinzugefügt
This commit is contained in:
23
ReallifeGamemode.Client/Player/nodm.ts
Normal file
23
ReallifeGamemode.Client/Player/nodm.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
export function isPlayerInNoDMZone(pos) {
|
||||
if (pos.x >= -540 && pos.x <= -531
|
||||
&& pos.y >= -2151 && pos.y <= -2139) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export default function nodmHandler() {
|
||||
|
||||
mp.events.add('playerEnterPolygon', (polygon) => {
|
||||
mp.gui.chat.push("entered");
|
||||
});
|
||||
|
||||
mp.events.add('playerLeavePolygon', (polygon) => {
|
||||
mp.gui.chat.push("leaved");
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
mp.events.call('toggleNoDmZone', isPlayerInNoDMZone(mp.players.local.position));
|
||||
}, 200);
|
||||
}
|
||||
Reference in New Issue
Block a user