liste of nodm zones
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { isInAnyPolygon } from "../Player/nodm";
|
||||
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/nodm";
|
||||
import polygons from "../polygons";
|
||||
|
||||
|
||||
function isTargetInPolygon(pos): boolean {
|
||||
let found = false;
|
||||
polygons.pool.forEach(zone => {
|
||||
|
||||
listNoDMZones.forEach(zone => {
|
||||
if (polygons.isPositionWithinPolygon(pos, zone, zone.dimension)) {
|
||||
found = true;
|
||||
return;
|
||||
@@ -26,7 +27,7 @@ export default function weapondamageUtil() {
|
||||
|
||||
mp.events.add('outgoingDamage', (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
|
||||
|
||||
if (isTargetInPolygon(targetEntity.position) || isInAnyPolygon) {
|
||||
if (isTargetInPolygon(targetEntity.position) || isInAnyNoDMPolygon) {
|
||||
mp.gui.chat.push("nodm");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user