From 87dbc00ccc69740d76fa04114938871e095d5628 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Thu, 25 Mar 2021 12:01:47 +0100 Subject: [PATCH] fix onlineliste --- ReallifeGamemode.Client/inputhelper/index.ts | 1 + .../Commands/UserCommands.cs | 5 ----- ReallifeGamemode.Server/Events/Key.cs | 17 +---------------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/ReallifeGamemode.Client/inputhelper/index.ts b/ReallifeGamemode.Client/inputhelper/index.ts index 23107c82..5ea5a963 100644 --- a/ReallifeGamemode.Client/inputhelper/index.ts +++ b/ReallifeGamemode.Client/inputhelper/index.ts @@ -48,6 +48,7 @@ export default class InputHelper { clearInterval(disableInputTimer); mp.events.remove('cef_inputhelper_sendvalue'); mp.events.remove('cef_request_title'); + mp.events.remove('closeinputhelper'); this.browser.destroy(); this.data.InInput = false; this.data.InMenu = false; diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 4d241138..6d460fbe 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -85,11 +85,6 @@ namespace ReallifeGamemode.Server.Commands [Command("hub")] public void CmdAnim(Player player) { - if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) - { - ChatService.NotAuthorized(player); - return; - } player.PlayAnimation("mp_am_hold_up", "handsup_base", (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl | AnimationFlags.Cancellable)); } } diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 55ddb858..97c73d91 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -617,29 +617,14 @@ namespace ReallifeGamemode.Server.Events { if (!player.IsLoggedIn()) return; List players = NAPI.Pools.GetAllPlayers(); - if(player.GetUser().Faction != null) - { var listPlayers = players.Select(p => new { Id = p.Handle.Value, p.Name, p.Ping, - FactionName = p.GetUser().Faction.Name, + FactionName = p.GetUser().Faction?.Name ?? "Zivilist", }) ; player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers)); - } - else - { - var listPlayers = players.Select(p => new - { - Id = p.Handle.Value, - p.Name, - p.Ping, - FactionName = "Zivilist", - }); - player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers)); - } - } [RemoteEvent("keyPress:K")]