test: nodm zone mit polygons

This commit is contained in:
Fabian
2021-04-22 18:15:57 +02:00
parent c276b87977
commit fd5299ffa4
2 changed files with 31 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
import { isPlayerInNoDMZone } from "../Player/nodm";
import { isInAnyPolygon, isTargetInPolygon } from "../Player/nodm";
import polygons from "../polygons";
export default function weapondamageUtil() {
let blockInput = false;
@@ -10,7 +11,8 @@ export default function weapondamageUtil() {
});
mp.events.add('outgoingDamage', (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
if (isPlayerInNoDMZone(targetEntity.position) || isPlayerInNoDMZone(sourceEntity.position)) {
if (isInAnyPolygon || isTargetInPolygon(targetEntity.position)) {
mp.gui.chat.push("Kein DM in NODM");
return true;
}
});