spawnschutz eingefügt
This commit is contained in:
@@ -28,6 +28,7 @@ export default function (globalData: IGlobalData): void {
|
|||||||
var cdTimestamp;
|
var cdTimestamp;
|
||||||
var countdownText;
|
var countdownText;
|
||||||
var blackScreenMode = false;
|
var blackScreenMode = false;
|
||||||
|
let spawnschutz = false;
|
||||||
|
|
||||||
let posX = 0.92;
|
let posX = 0.92;
|
||||||
let posY = 0.45;
|
let posY = 0.45;
|
||||||
@@ -89,6 +90,10 @@ export default function (globalData: IGlobalData): void {
|
|||||||
noDmZone = toggle;
|
noDmZone = toggle;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mp.events.add("toggleSpawnschutz", (toggle) => {
|
||||||
|
spawnschutz = toggle;
|
||||||
|
});
|
||||||
|
|
||||||
mp.events.add("jailTime", (time) => {
|
mp.events.add("jailTime", (time) => {
|
||||||
jailTime = JSON.parse(time);
|
jailTime = JSON.parse(time);
|
||||||
});
|
});
|
||||||
@@ -361,6 +366,17 @@ export default function (globalData: IGlobalData): void {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (spawnschutz) {
|
||||||
|
mp.game.graphics.drawText("~r~Spawnschutz", [0.92, 0.75],
|
||||||
|
{
|
||||||
|
font: 2,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.7, 0.7],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (countdown > 0) {
|
if (countdown > 0) {
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
var diff = Math.trunc((now - cdTimestamp) / 1000);
|
var diff = Math.trunc((now - cdTimestamp) / 1000);
|
||||||
|
|||||||
@@ -69,5 +69,7 @@ export default function (globalData: IGlobalData): void {
|
|||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
loginCam.setActive(false);
|
loginCam.setActive(false);
|
||||||
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
||||||
|
|
||||||
|
mp.events.call("toggleSpawnschutz", true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
9
ReallifeGamemode.Client/Player/spawnschutz.ts
Normal file
9
ReallifeGamemode.Client/Player/spawnschutz.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export let spawnschutzEnabled = true;
|
||||||
|
|
||||||
|
export default function spawnschutz() {
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
mp.events.call("toggleSpawnschutz", false);
|
||||||
|
spawnschutzEnabled = false;
|
||||||
|
}, 60000);
|
||||||
|
}
|
||||||
@@ -268,6 +268,10 @@ antiAfk(globalData);
|
|||||||
import ammunation from './Interaction/ammunation/ammunation';
|
import ammunation from './Interaction/ammunation/ammunation';
|
||||||
ammunation(globalData);
|
ammunation(globalData);
|
||||||
|
|
||||||
|
import spawnschutz from './Player/spawnschutz';
|
||||||
|
spawnschutz();
|
||||||
|
|
||||||
|
|
||||||
require('./Gui/policedepartment');
|
require('./Gui/policedepartment');
|
||||||
require('./Gui/helptext');
|
require('./Gui/helptext');
|
||||||
require('./admin/spectate');
|
require('./admin/spectate');
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/nodm";
|
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/nodm";
|
||||||
import polygons from "../polygons";
|
import polygons from "../polygons";
|
||||||
import { getWantedCount } from "../Gui/wanteds";
|
import { getWantedCount } from "../Gui/wanteds";
|
||||||
|
import { spawnschutzEnabled } from "../Player/spawnschutz";
|
||||||
|
|
||||||
|
|
||||||
function isTargetInPolygon(pos): boolean {
|
function isTargetInPolygon(pos): boolean {
|
||||||
@@ -30,6 +31,10 @@ export default function weapondamageUtil() {
|
|||||||
if ((isTargetInPolygon(sourceEntity.position) || isInAnyNoDMPolygon) && getWantedCount() === 0) {
|
if ((isTargetInPolygon(sourceEntity.position) || isInAnyNoDMPolygon) && getWantedCount() === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (spawnschutzEnabled) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("render", () => {
|
mp.events.add("render", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user