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 jailTime = 0;
let att_score = 0; let att_score = 0;
let def_score = 0; let def_score = 0;
let gangwarTimer = 0;
let att = null; let att = null;
let def = null; let def = null;
let countdown = 0; let countdown = 0;
@@ -77,11 +78,12 @@ export default function (globalData: IGlobalData): void {
jailTime = JSON.parse(time); jailTime = JSON.parse(time);
}); });
mp.events.add("GangwarScore", (attacker, defender, attscore, defscore) => { mp.events.add("GangwarScore", (attacker, defender, attscore, defscore, gwTimer) => {
att = attacker; att = attacker;
def = defender; def = defender;
att_score = attscore; att_score = attscore;
def_score = defscore; def_score = defscore;
gangwarTimer = gwTimer;
}); });
mp.events.add("countdown", (timer, text) => { mp.events.add("countdown", (timer, text) => {
@@ -259,7 +261,13 @@ export default function (globalData: IGlobalData): void {
} }
if (att_score >= 1 && def_score < 200) { 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, font: 4,
color: [255, 255, 255, 255], color: [255, 255, 255, 255],
@@ -267,7 +275,7 @@ export default function (globalData: IGlobalData): void {
outline: true, outline: true,
centre: false centre: false
}) })
mp.game.graphics.drawText("~w~Gangwar", [0.07, 0.514], mp.game.graphics.drawText("~w~Gangwar", [0.07, 0.500],
{ {
font: 1, font: 1,
color: [255, 255, 255, 255], color: [255, 255, 255, 255],
@@ -275,7 +283,7 @@ export default function (globalData: IGlobalData): void {
outline: true, outline: true,
centre: false 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)
} }
} }

View File

@@ -152,7 +152,7 @@ namespace ReallifeGamemode.Server.Gangwar
foreach (Player gangwarPlayer in this.playerInGangwar) foreach (Player gangwarPlayer in this.playerInGangwar)
{ {
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score); gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 900 - timerCount);
} }
if (this.Att_Score >= 200) if (this.Att_Score >= 200)
{ {
@@ -169,7 +169,7 @@ namespace ReallifeGamemode.Server.Gangwar
{ {
foreach (Player gangwarPlayer in this.playerInGangwar) foreach (Player gangwarPlayer in this.playerInGangwar)
{ {
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
} }
this.takeOver(this.Attacker); this.takeOver(this.Attacker);
this.Def_Score = 0; this.Def_Score = 0;
@@ -179,7 +179,7 @@ namespace ReallifeGamemode.Server.Gangwar
{ {
foreach (Player gangwarPlayer in this.playerInGangwar) foreach (Player gangwarPlayer in this.playerInGangwar)
{ {
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
} }
this.takeOver(this.Owner); this.takeOver(this.Owner);
this.Att_Score = 0; this.Att_Score = 0;
@@ -189,7 +189,7 @@ namespace ReallifeGamemode.Server.Gangwar
{ {
foreach (Player gangwarPlayer in this.playerInGangwar) foreach (Player gangwarPlayer in this.playerInGangwar)
{ {
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
} }
this.takeOver(this.Owner); this.takeOver(this.Owner);
this.Def_Score = 0; this.Def_Score = 0;