diff --git a/ReallifeGamemode.Client/Gui/infobox.ts b/ReallifeGamemode.Client/Gui/infobox.ts index b43f9cdd..b0a81b79 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: [1.5, 1.5], + outline: true, + centre: false + }) + } + } }); } \ No newline at end of file diff --git a/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs b/ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs new file mode 100644 index 00000000..1cdb8c19 --- /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() + { + + } + } +} diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 73482fc1..5c0002fa 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]", GreedyArg = true)] + 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); }