This commit is contained in:
2020-08-03 21:40:35 +02:00
parent 7ef07b379c
commit 26f9aabfc7
2 changed files with 16 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ export default function (globalData: IGlobalData): void {
let jailTime = 0;
let att_score = 0;
let def_score = 0;
let gangwarTimer = 0;
let att = null;
let def = null;
let countdown = 0;
@@ -77,11 +78,12 @@ export default function (globalData: IGlobalData): void {
jailTime = JSON.parse(time);
});
mp.events.add("GangwarScore", (attacker, defender, attscore, defscore) => {
mp.events.add("GangwarScore", (attacker, defender, attscore, defscore, gwTimer) => {
att = attacker;
def = defender;
att_score = attscore;
def_score = defscore;
gangwarTimer = gwTimer;
});
mp.events.add("countdown", (timer, text) => {
@@ -259,7 +261,13 @@ export default function (globalData: IGlobalData): void {
}
if (att_score >= 1 && def_score < 200) {
mp.game.graphics.drawText("~y~" + def + " " + def_score + " : " + att_score + " " + att, [0.07, 0.55],
let gangwarTimerDraw = (Math.floor(gangwarTimer / 60) + 1);
if (gangwarTimerDraw > 15 || Number.isNaN(gangwarTimerDraw)) {
gangwarTimerDraw = 15;
}
mp.game.graphics.drawText("~y~" + def + " " + def_score + " : " + att_score + " " + att + " " + "\nRestzeit: " + gangwarTimerDraw + " Minuten", [0.07, 0.54],
{
font: 4,
color: [255, 255, 255, 255],
@@ -267,7 +275,7 @@ export default function (globalData: IGlobalData): void {
outline: true,
centre: false
})
mp.game.graphics.drawText("~w~Gangwar", [0.07, 0.514],
mp.game.graphics.drawText("~w~Gangwar", [0.07, 0.500],
{
font: 1,
color: [255, 255, 255, 255],
@@ -275,7 +283,7 @@ export default function (globalData: IGlobalData): void {
outline: true,
centre: false
})
mp.game.graphics.drawRect(0.0, 0.555, 0.3, 0.08, 0, 0, 0, 70)
mp.game.graphics.drawRect(0.0, 0.555, 0.3, 0.11, 0, 0, 0, 70)
}
}