diff --git a/ReallifeGamemode.Client/Gui/infobox.ts b/ReallifeGamemode.Client/Gui/infobox.ts index 135d11d8..52750cd0 100644 --- a/ReallifeGamemode.Client/Gui/infobox.ts +++ b/ReallifeGamemode.Client/Gui/infobox.ts @@ -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) } } diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index cbeec4c2..d88fb37f 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -152,7 +152,7 @@ namespace ReallifeGamemode.Server.Gangwar 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) { @@ -169,7 +169,7 @@ namespace ReallifeGamemode.Server.Gangwar { 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.Def_Score = 0; @@ -179,7 +179,7 @@ namespace ReallifeGamemode.Server.Gangwar { 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.Att_Score = 0; @@ -189,7 +189,7 @@ namespace ReallifeGamemode.Server.Gangwar { 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.Def_Score = 0;