From 60a494dfca586001f8af48ae1c5e3f1b3c66fab7 Mon Sep 17 00:00:00 2001 From: Gold KingZ <48490385+oqyh@users.noreply.github.com> Date: Sat, 30 Mar 2024 15:31:39 +0400 Subject: [PATCH] 1.0.7 --- Helper.cs | 12 ++++++------ Vote-GoldKingZ.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Helper.cs b/Helper.cs index 4d4d661..53396b9 100644 --- a/Helper.cs +++ b/Helper.cs @@ -76,30 +76,30 @@ public static bool IsPlayerInGroupPermission(CCSPlayerController player, string } public static List GetCounterTerroristController() { - var playerList = Utilities.FindAllEntitiesByDesignerName("cs_player_controller").Where(p => p != null && p.IsValid && p.Team == CsTeam.CounterTerrorist).ToList(); + var playerList = Utilities.FindAllEntitiesByDesignerName("cs_player_controller").Where(p => p != null && p.IsValid && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected && p.Team == CsTeam.CounterTerrorist).ToList(); return playerList; } public static List GetTerroristController() { - var playerList = Utilities.FindAllEntitiesByDesignerName("cs_player_controller").Where(p => p != null && p.IsValid && p.Team == CsTeam.Terrorist).ToList(); + var playerList = Utilities.FindAllEntitiesByDesignerName("cs_player_controller").Where(p => p != null && p.IsValid && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected && p.Team == CsTeam.Terrorist).ToList(); return playerList; } public static List GetAllController() { - var playerList = Utilities.FindAllEntitiesByDesignerName("cs_player_controller").Where(p => p != null && p.IsValid).ToList(); + var playerList = Utilities.FindAllEntitiesByDesignerName("cs_player_controller").Where(p => p != null && p.IsValid && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected).ToList(); return playerList; } public static int GetCounterTerroristCount() { - return Utilities.GetPlayers().Count(p => p.TeamNum == (byte)CsTeam.CounterTerrorist && !p.IsHLTV); + return Utilities.GetPlayers().Count(p => p != null && p.IsValid && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected && p.TeamNum == (byte)CsTeam.CounterTerrorist); } public static int GetTerroristCount() { - return Utilities.GetPlayers().Count(p => p.TeamNum == (byte)CsTeam.Terrorist && !p.IsHLTV); + return Utilities.GetPlayers().Count(p => p != null && p.IsValid && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected && p.TeamNum == (byte)CsTeam.Terrorist); } public static int GetAllCount() { - return Utilities.GetPlayers().Count(p => !p.IsHLTV); + return Utilities.GetPlayers().Count(p => p != null && p.IsValid && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected); } public static void ClearVariablesVoteKick() diff --git a/Vote-GoldKingZ.cs b/Vote-GoldKingZ.cs index b73e456..6098e79 100644 --- a/Vote-GoldKingZ.cs +++ b/Vote-GoldKingZ.cs @@ -13,7 +13,7 @@ namespace Vote_GoldKingZ; public class VoteGoldKingZ : BasePlugin { public override string ModuleName => "Vote (Kick , Mute , Banned, Vips)"; - public override string ModuleVersion => "1.0.6"; + public override string ModuleVersion => "1.0.7"; public override string ModuleAuthor => "Gold KingZ"; public override string ModuleDescription => "https://github.com/oqyh";