NoDM: Nicht für Leude mit Wanteds

This commit is contained in:
hydrant
2021-04-22 20:11:52 +02:00
parent 7ca3802096
commit 798a84813c
2 changed files with 12 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/nodm";
import polygons from "../polygons";
import { getWantedCount } from "../Gui/wanteds";
function isTargetInPolygon(pos): boolean {
@@ -25,8 +26,8 @@ export default function weapondamageUtil() {
player.setSuffersCriticalHits(false);
});
mp.events.add('outgoingDamage', (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
if (isTargetInPolygon(targetEntity.position) || isInAnyNoDMPolygon) {
mp.events.add(RageEnums.EventKey.INCOMING_DAMAGE, (sourceEntity: EntityMp, sourcePlayer: PlayerMp, targetEntity: EntityMp, weapon: number, boneIndex: number, damage: number) => {
if ((isTargetInPolygon(sourceEntity.position) || isInAnyNoDMPolygon) && getWantedCount() === 0) {
return true;
}
});