From cb61e860a9dddcc7ef7672b6a427906b8bad6062 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 14 Apr 2021 21:03:14 +0200 Subject: [PATCH 1/2] =?UTF-8?q?megaphone=20befehl=20f=C3=BCr=20staatsmario?= =?UTF-8?q?netten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/FactionCommands.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index 9dc24c1e..00a15775 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -408,6 +408,31 @@ namespace ReallifeGamemode.Server.Commands #region Staatsfraktionen (LSPD / FBI) Commands + [Command("m", "~m~Benutzung: ~s~/m [Message]")] + public void CmdFactionMegaphone(Player player, String message) + { + User user = player.GetUser(); + if (user == null || (user.FactionId != 1 && user.FactionId != 3)) + { + ChatService.NotAuthorized(player); + return; + } + + if (!player.IsDuty()) + { + ChatService.ErrorMessage(player, "Du bist nicht im Dienst"); + return; + } + + if (!player.IsInVehicle) + { + ChatService.ErrorMessage(player, "Du bist nicht in einem Fahrzeug"); + return; + } + + ChatService.SendInRange(player.Position, 15, "!{#FFFF00}[" + player.GetUser().Faction.Name + " " + player.Name + ": !{#FFFF00}" + message + "]"); + } + [Command("cuff", "~m~Benutzung: ~s~/cuff")] public void CmdFactionCuff(Player player) { From 402e6ee04833ff5fad32e11e4fade0eed90c1fa0 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 14 Apr 2021 21:16:14 +0200 Subject: [PATCH 2/2] sani benachrichtigungen bei tod und arevive --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 1 + ReallifeGamemode.Server/Events/Disconnect.cs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 8fcad633..78e0d098 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1402,6 +1402,7 @@ namespace ReallifeGamemode.Server.Commands } target.TriggerEvent("onPlayerRevived"); target.SendNotification("Du wurdest von Admin ~y~" + player.Name + "~s~ wiederbelebt."); + ChatService.BroadcastFaction("Info: " + "Der Auftrag von " + target.Name + " wurde entfernt (Administrativ wiederbelebt)", new List() { 2 }); target.SetData("isDead", false); using (var dbContext = new DatabaseContext()) { diff --git a/ReallifeGamemode.Server/Events/Disconnect.cs b/ReallifeGamemode.Server/Events/Disconnect.cs index ef442350..e62e8ece 100644 --- a/ReallifeGamemode.Server/Events/Disconnect.cs +++ b/ReallifeGamemode.Server/Events/Disconnect.cs @@ -62,6 +62,13 @@ namespace ReallifeGamemode.Server.Events { ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING); } + + if (!player.HasData("isDead") || !player.GetData("isDead")) + { + ChatService.BroadcastFaction("Info: " + "Der Auftrag von " + player.Name + " wurde entfernt (Ausgeloggt)", new List() { 2 }); + return; + } + /* TaxiDriverJob taxiJob = JobManager.GetJob(); TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault();