From c73cd70d9080ca443b8148930299ea46d85c7ed4 Mon Sep 17 00:00:00 2001 From: Fabian Fabian Date: Sat, 7 Sep 2019 18:30:00 +0200 Subject: [PATCH 1/5] added airplane business --- .../Business/AirplaneDealerBusiness.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs diff --git a/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs b/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs new file mode 100644 index 00000000..a28061bc --- /dev/null +++ b/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using GTANetworkAPI; + +namespace ReallifeGamemode.Server.Business +{ + class AirplaneDealerBusiness : CarDealerBusinessBase + { + + public override int Id => 7; + + public override string Name => "Flugzeug Shop"; + + public override Vector3 Position => new Vector3(-941.5253, -2954.994, 13.94508); + + public override Vector3 CarSpawnPositon => new Vector3(-1029.062, -2972.129, 13.94598; + + public override float CarSpawnHeading => 356.6f; + + public override void Load() + { + + } + } +} From f1c3341cac128453e38dfedbe3a149642fca5886 Mon Sep 17 00:00:00 2001 From: Fabian Fabian Date: Sat, 7 Sep 2019 18:32:53 +0200 Subject: [PATCH 2/5] KLAMMERFEHLER --- ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs b/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs index a28061bc..1cdb8c19 100644 --- a/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs +++ b/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs @@ -14,7 +14,7 @@ namespace ReallifeGamemode.Server.Business public override Vector3 Position => new Vector3(-941.5253, -2954.994, 13.94508); - public override Vector3 CarSpawnPositon => new Vector3(-1029.062, -2972.129, 13.94598; + public override Vector3 CarSpawnPositon => new Vector3(-1029.062, -2972.129, 13.94598); public override float CarSpawnHeading => 356.6f; From bac142bf1b378a7797f454cdaf8d669af9a39c5f Mon Sep 17 00:00:00 2001 From: Fabian Fabian Date: Sat, 7 Sep 2019 19:48:07 +0200 Subject: [PATCH 3/5] added /countdown command --- ReallifeGamemode.Client/Gui/infobox.ts | 28 ++++++++++++++++++- .../Commands/AdminCommands.cs | 24 ++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Gui/infobox.ts b/ReallifeGamemode.Client/Gui/infobox.ts index b43f9cdd..a3f3a3d4 100644 --- a/ReallifeGamemode.Client/Gui/infobox.ts +++ b/ReallifeGamemode.Client/Gui/infobox.ts @@ -16,6 +16,9 @@ export default function (globalData: GlobalData): void { var adutyMode = false; var dutyMode = false; let jailTime = 0; + let countdown = 0; + var cdTimestamp; + var countdownText; let posX = 0.92; let posY = 0.45; @@ -47,7 +50,6 @@ export default function (globalData: GlobalData): void { playerName = pName; playerId = pId; draw = true; - }); mp.events.add('toggleADutyMode', (toggle) => { @@ -66,6 +68,12 @@ export default function (globalData: GlobalData): void { jailTime = time; }); + mp.events.add("countdown", (timer, text) => { + countdown = timer; + cdTimestamp = Date.now(); + countdownText = text; + }); + mp.events.add("toggleUi", (show) => { if (show === false) { @@ -256,5 +264,23 @@ export default function (globalData: GlobalData): void { centre: false }) } + + if (countdown > 0) { + var now = Date.now(); + var diff = Math.trunc((now - cdTimestamp) / 1000); + var out = countdown - diff; + if (out < 0) { + countdown = 0 + } else { + mp.game.graphics.drawText("~y~" + countdownText + ": " + out + "", [0.5, 0.8], + { + font: 7, + color: [64, 224, 208, 255], + scale: [2, 2], + outline: true, + centre: false + }) + } + } }); } \ No newline at end of file diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 73482fc1..5925733b 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -353,6 +353,24 @@ namespace ReallifeGamemode.Server.Commands #endregion #region ALevel1 + + [Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]")] + public void CmdCountdown(Client player, string timer_string, string text) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + + int timer = int.Parse(timer_string); + + foreach (Client c in NAPI.Pools.GetAllPlayers()) + { + c.TriggerEvent("countdown", timer, text); + } + } + [Command("aunjail", "~m~Benutzung: ~s~/aunjail [Spieler]", GreedyArg = true)] public void CmdAdminAunjai(Client player, string targetname) { @@ -360,6 +378,12 @@ namespace ReallifeGamemode.Server.Commands if (target == null) return; + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + ReallifeGamemode.Server.Wanted.Jail.Release_Jail_Admin(player, target); } From 671c6a5b3f157e13e43a305b0e462ec3a52d3261 Mon Sep 17 00:00:00 2001 From: Fabian Fabian Date: Sat, 7 Sep 2019 19:52:24 +0200 Subject: [PATCH 4/5] fixxxxxx --- ReallifeGamemode.Client/Gui/infobox.ts | 2 +- ReallifeGamemode.Server/Commands/AdminCommands.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/infobox.ts b/ReallifeGamemode.Client/Gui/infobox.ts index a3f3a3d4..b0a81b79 100644 --- a/ReallifeGamemode.Client/Gui/infobox.ts +++ b/ReallifeGamemode.Client/Gui/infobox.ts @@ -276,7 +276,7 @@ export default function (globalData: GlobalData): void { { font: 7, color: [64, 224, 208, 255], - scale: [2, 2], + scale: [1.5, 1.5], outline: true, centre: false }) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 5925733b..b41ca6e4 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -354,7 +354,7 @@ namespace ReallifeGamemode.Server.Commands #region ALevel1 - [Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]")] + [Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true))] public void CmdCountdown(Client player, string timer_string, string text) { if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) From 22a83e9a6b72cd5d8da12cfe11f3e39d83fb0e8c Mon Sep 17 00:00:00 2001 From: Fabian Fabian Date: Sat, 7 Sep 2019 19:53:55 +0200 Subject: [PATCH 5/5] fixxxxxx --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index b41ca6e4..5c0002fa 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -354,7 +354,7 @@ namespace ReallifeGamemode.Server.Commands #region ALevel1 - [Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true))] + [Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)] public void CmdCountdown(Client player, string timer_string, string text) { if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)