From 5a9367ae89edea5a4e29fe60c2816424ff38cfac Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Sat, 19 Oct 2024 03:52:33 +0200 Subject: [PATCH] 1.6.4a - New give command - Added `@css/permmute` flag to allow perm penalties - Fixed mute when player silenced - Added CleanModule - allow to clean weapons on ground --- CS2-SimpleAdmin/Api/CS2_SimpleAdminApi.cs | 1 - CS2-SimpleAdmin/CS2-SimpleAdmin.cs | 3 +- CS2-SimpleAdmin/Commands/basebans.cs | 2 +- CS2-SimpleAdmin/Commands/basechat.cs | 1 - CS2-SimpleAdmin/Commands/basecommands.cs | 1 - CS2-SimpleAdmin/Commands/basecomms.cs | 26 +++++++- CS2-SimpleAdmin/Commands/basevotes.cs | 1 - CS2-SimpleAdmin/Commands/funcommands.cs | 1 - CS2-SimpleAdmin/Commands/playercommands.cs | 32 ++++++---- CS2-SimpleAdmin/Config.cs | 5 +- CS2-SimpleAdmin/Helper.cs | 50 ++++++++++++++- CS2-SimpleAdmin/VERSION | 2 +- .../CS2-SimpleAdminApi.dll" | Bin 0 -> 8192 bytes .../CS2-SimpleAdmin_CleanModule.cs" | 59 ++++++++++++++++++ .../CS2-SimpleAdmin_CleanModule.csproj" | 20 ++++++ .../CS2-SimpleAdmin_CleanModule.sln" | 16 +++++ .../CS2-SimpleAdminApi.dll | Bin 7680 -> 8192 bytes 17 files changed, 193 insertions(+), 27 deletions(-) create mode 100644 "Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdminApi.dll" create mode 100644 "Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.cs" create mode 100644 "Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.csproj" create mode 100644 "Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.sln" diff --git a/CS2-SimpleAdmin/Api/CS2_SimpleAdminApi.cs b/CS2-SimpleAdmin/Api/CS2_SimpleAdminApi.cs index c66c344..2a960a6 100644 --- a/CS2-SimpleAdmin/Api/CS2_SimpleAdminApi.cs +++ b/CS2-SimpleAdmin/Api/CS2_SimpleAdminApi.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Commands; using CounterStrikeSharp.API.Modules.Entities; diff --git a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs index e67a1b4..81a7a05 100644 --- a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs @@ -3,7 +3,6 @@ using CounterStrikeSharp.API.Core.Capabilities; using CounterStrikeSharp.API.Modules.Commands; using CounterStrikeSharp.API.Modules.Commands.Targeting; -using CounterStrikeSharp.API.Modules.Entities; using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions; using CS2_SimpleAdmin.Managers; using CS2_SimpleAdminApi; @@ -20,7 +19,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)"); public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)"; public override string ModuleAuthor => "daffyy & Dliix66"; - public override string ModuleVersion => "1.6.3b"; + public override string ModuleVersion => "1.6.4a"; public override void Load(bool hotReload) { diff --git a/CS2-SimpleAdmin/Commands/basebans.cs b/CS2-SimpleAdmin/Commands/basebans.cs index 7c2f6cd..7262eb8 100644 --- a/CS2-SimpleAdmin/Commands/basebans.cs +++ b/CS2-SimpleAdmin/Commands/basebans.cs @@ -237,7 +237,7 @@ private bool CheckValidBan(CCSPlayerController? caller, int duration) { if (caller == null) return true; - bool canPermBan = AdminManager.PlayerHasPermissions(caller, "@css/permban"); + var canPermBan = AdminManager.PlayerHasPermissions(caller, "@css/permban"); if (duration <= 0 && canPermBan == false) { diff --git a/CS2-SimpleAdmin/Commands/basechat.cs b/CS2-SimpleAdmin/Commands/basechat.cs index 3e8896f..bc72d69 100644 --- a/CS2-SimpleAdmin/Commands/basechat.cs +++ b/CS2-SimpleAdmin/Commands/basechat.cs @@ -1,5 +1,4 @@ using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Core.Translations; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Commands; diff --git a/CS2-SimpleAdmin/Commands/basecommands.cs b/CS2-SimpleAdmin/Commands/basecommands.cs index 7447c3e..02d29b4 100644 --- a/CS2-SimpleAdmin/Commands/basecommands.cs +++ b/CS2-SimpleAdmin/Commands/basecommands.cs @@ -1,6 +1,5 @@ using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Core.Translations; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Commands; diff --git a/CS2-SimpleAdmin/Commands/basecomms.cs b/CS2-SimpleAdmin/Commands/basecomms.cs index 4aa3f3d..bdd365c 100644 --- a/CS2-SimpleAdmin/Commands/basecomms.cs +++ b/CS2-SimpleAdmin/Commands/basecomms.cs @@ -1,6 +1,5 @@ using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Commands; using CS2_SimpleAdmin.Managers; @@ -50,6 +49,7 @@ internal void Gag(CCSPlayerController? caller, CCSPlayerController player, int t { if (Database == null || !player.IsValid || !player.UserId.HasValue) return; if (!caller.CanTarget(player)) return; + if (!CheckValidMute(caller, time)) return; // Set default caller name if not provided callerName ??= caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName; @@ -126,6 +126,7 @@ public void OnAddGagCommand(CCSPlayerController? caller, CommandInfo command) : (_localizer?["sa_unknown"] ?? "Unknown"); int.TryParse(command.GetArg(2), out var time); + if (!CheckValidMute(caller, time)) return; // Get player and admin info var adminInfo = caller != null && caller.UserId.HasValue ? PlayersInfo[caller.UserId.Value] : null; @@ -264,6 +265,7 @@ internal void Mute(CCSPlayerController? caller, CCSPlayerController player, int { if (Database == null || !player.IsValid || !player.UserId.HasValue) return; if (!caller.CanTarget(player)) return; + if (!CheckValidMute(caller, time)) return; // Set default caller name if not provided callerName ??= caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName; @@ -343,6 +345,7 @@ public void OnAddMuteCommand(CCSPlayerController? caller, CommandInfo command) : (_localizer?["sa_unknown"] ?? "Unknown"); int.TryParse(command.GetArg(2), out var time); + if (!CheckValidMute(caller, time)) return; // Get player and admin info var adminInfo = caller != null && caller.UserId.HasValue ? PlayersInfo[caller.UserId.Value] : null; @@ -483,6 +486,7 @@ internal void Silence(CCSPlayerController? caller, CCSPlayerController player, i { if (Database == null || !player.IsValid || !player.UserId.HasValue) return; if (!caller.CanTarget(player)) return; + if (!CheckValidMute(caller, time)) return; // Set default caller name if not provided callerName ??= caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName; @@ -499,6 +503,7 @@ internal void Silence(CCSPlayerController? caller, CCSPlayerController player, i // Add penalty to the player's penalty manager PlayerPenaltyManager.AddPenalty(player.Slot, PenaltyType.Silence, Time.ActualDateTime().AddMinutes(time), time); + player.VoiceFlags = VoiceFlags.Muted; // Determine message keys and arguments based on silence time (permanent or timed) var (messageKey, activityMessageKey, playerArgs, adminActivityArgs) = time == 0 @@ -559,6 +564,7 @@ public void OnAddSilenceCommand(CCSPlayerController? caller, CommandInfo command : (_localizer?["sa_unknown"] ?? "Unknown"); int.TryParse(command.GetArg(2), out var time); + if (!CheckValidMute(caller, time)) return; // Get player and admin info var adminInfo = caller != null && caller.UserId.HasValue ? PlayersInfo[caller.UserId.Value] : null; @@ -663,4 +669,22 @@ public void OnUnsilenceCommand(CCSPlayerController? caller, CommandInfo command) command.ReplyToCommand($"Unsilenced offline player with pattern {pattern}."); } } + + private bool CheckValidMute(CCSPlayerController? caller, int duration) + { + if (caller == null) return true; + + var canPermMute = AdminManager.PlayerHasPermissions(caller, "@css/permmute"); + + if (duration <= 0 && canPermMute == false) + { + caller.PrintToChat($"{_localizer!["sa_prefix"]} {_localizer["sa_ban_perm_restricted"]}"); + return false; + } + + if (duration <= Config.OtherSettings.MaxMuteDuration || canPermMute) return true; + + caller.PrintToChat($"{_localizer!["sa_prefix"]} {_localizer["sa_ban_max_duration_exceeded", Config.OtherSettings.MaxMuteDuration]}"); + return false; + } } \ No newline at end of file diff --git a/CS2-SimpleAdmin/Commands/basevotes.cs b/CS2-SimpleAdmin/Commands/basevotes.cs index f65d9dc..374c8d8 100644 --- a/CS2-SimpleAdmin/Commands/basevotes.cs +++ b/CS2-SimpleAdmin/Commands/basevotes.cs @@ -1,5 +1,4 @@ using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Core.Translations; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Commands; diff --git a/CS2-SimpleAdmin/Commands/funcommands.cs b/CS2-SimpleAdmin/Commands/funcommands.cs index 19b52a1..9f67c47 100644 --- a/CS2-SimpleAdmin/Commands/funcommands.cs +++ b/CS2-SimpleAdmin/Commands/funcommands.cs @@ -1,5 +1,4 @@ using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Commands; diff --git a/CS2-SimpleAdmin/Commands/playercommands.cs b/CS2-SimpleAdmin/Commands/playercommands.cs index 5debea2..c9ae79c 100644 --- a/CS2-SimpleAdmin/Commands/playercommands.cs +++ b/CS2-SimpleAdmin/Commands/playercommands.cs @@ -67,18 +67,11 @@ public void OnGiveCommand(CCSPlayerController? caller, CommandInfo command) var weaponName = command.GetArg(2); // check if item is typed - if (weaponName.Length < 5) - { - command.ReplyToCommand($"No weapon typed."); - return; - } - - // check if item is valid - if (!weaponName.Contains("weapon_") && !weaponName.Contains("item_")) - { - command.ReplyToCommand($"{weaponName} is not a valid item."); - return; - } + // if (weaponName.Length < 2) + // { + // command.ReplyToCommand($"No weapon typed."); + // return; + // } // check if weapon is knife if (weaponName.Contains("_knife") || weaponName.Contains("bayonet")) @@ -105,9 +98,22 @@ private static void GiveWeapon(CCSPlayerController? caller, CCSPlayerController // Set default caller name if not provided callerName ??= caller != null ? caller.PlayerName : _localizer?["sa_console"] ?? "Console"; + var weapons = WeaponHelper.GetWeaponsByPartialName(weaponName); + + switch (weapons.Count) + { + case 0: + return; + case > 1: + { + var weaponList = string.Join(", ", weapons.Select(w => w.EnumMemberValue)); + command?.ReplyToCommand($"Found weapons with a similar name: {weaponList}"); + return; + } + } // Give weapon to the player - player.GiveNamedItem(weaponName); + player.GiveNamedItem(weapons.First().EnumValue); // Log the command if (command == null) diff --git a/CS2-SimpleAdmin/Config.cs b/CS2-SimpleAdmin/Config.cs index f523734..df40481 100644 --- a/CS2-SimpleAdmin/Config.cs +++ b/CS2-SimpleAdmin/Config.cs @@ -201,6 +201,9 @@ public class OtherSettings [JsonPropertyName("MaxBanDuration")] public int MaxBanDuration { get; set; } = 60 * 24 * 7; + + [JsonPropertyName("MaxMuteDuration")] + public int MaxMuteDuration { get; set; } = 60 * 24 * 7; [JsonPropertyName("ExpireOldIpBans")] public int ExpireOldIpBans { get; set; } = 0; @@ -220,7 +223,7 @@ public class OtherSettings public class CS2_SimpleAdminConfig : BasePluginConfig { - [JsonPropertyName("ConfigVersion")] public override int Version { get; set; } = 21; + [JsonPropertyName("ConfigVersion")] public override int Version { get; set; } = 22; [JsonPropertyName("DatabaseHost")] public string DatabaseHost { get; set; } = ""; diff --git a/CS2-SimpleAdmin/Helper.cs b/CS2-SimpleAdmin/Helper.cs index ce6f797..238360a 100644 --- a/CS2-SimpleAdmin/Helper.cs +++ b/CS2-SimpleAdmin/Helper.cs @@ -1,5 +1,4 @@ -using System.Globalization; -using CounterStrikeSharp.API; +using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Core.Translations; using CounterStrikeSharp.API.Modules.Admin; @@ -15,9 +14,11 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; +using CounterStrikeSharp.API.Modules.Entities.Constants; using CS2_SimpleAdmin.Managers; namespace CS2_SimpleAdmin; @@ -625,4 +626,47 @@ public static DateTime ActualDateTime() return utcNow; } } -} \ No newline at end of file +} + +public static class WeaponHelper +{ + private static readonly Lazy> WeaponsEnumCache = new(BuildEnumMemberMap); + + private static Dictionary BuildEnumMemberMap() + { + var dictionary = new Dictionary(); + + foreach (var field in typeof(CsItem).GetFields(BindingFlags.Public | BindingFlags.Static)) + { + var attribute = field.GetCustomAttribute(); + if (attribute?.Value == null) continue; + if (field.GetValue(null) is not CsItem csItem) + continue; + var enumValue = field.GetValue(null); + + dictionary.TryAdd(attribute.Value, csItem); + } + + return dictionary; + } + + public static CsItem? GetEnumFromWeaponName(string weaponName) + { + if (WeaponsEnumCache.Value.TryGetValue(weaponName, out var csItem)) + { + return csItem; + } + + return null; + } + + public static List<(string EnumMemberValue, CsItem EnumValue)> GetWeaponsByPartialName(string input) + { + var matchingWeapons = WeaponsEnumCache.Value + .Where(kvp => kvp.Key.Contains(input)) + .Select(kvp => (kvp.Key, kvp.Value)) + .ToList(); + + return matchingWeapons; + } +} diff --git a/CS2-SimpleAdmin/VERSION b/CS2-SimpleAdmin/VERSION index 12bfe62..9ff7676 100644 --- a/CS2-SimpleAdmin/VERSION +++ b/CS2-SimpleAdmin/VERSION @@ -1 +1 @@ -1.6.3b \ No newline at end of file +1.6.4a \ No newline at end of file diff --git "a/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdminApi.dll" "b/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdminApi.dll" new file mode 100644 index 0000000000000000000000000000000000000000..b7283c2ce01b88b33c2ac23f9b052051fb11fdbe GIT binary patch literal 8192 zcmeHMYit}>6+U-%XLs$yj=iz-XkMEpw4sm1kH&RMO1<$qiQ71FvyR4$2);E;qq%Y2_ZsQ(x}U9o zQtkTL`k{lC6D!(P6eU?Qi zAB5gLO!N@Fz>b(*#)uX}cHd^Aq1kP3#m9&uHSH1bJ8Ss3YaVgI|8^MwZL(J1Zg5g! zL}PK=vD4thwjL0?&`a>tlpa_gx6Nz;9obeI!^67P;;AV;MB8duAs=JEqOffm>2!QO z>~0}aBK^-{n~jl0r-MCHp zp67i$d`-M9-r3gKzJ>Qerz~(9LABw7M6aU0is_VVTlqohPC_j5zH`{Ajkyf$!NUqW}`M2E-?JP`y2`}7b!A7H#k@FBr% zB0nJXYXR19yJ)yc=pMQZ{S~mD_R>?KdRj`K0zRkzQwvcTJsasVD#PBzzz}sx|DR|) zYBe;}(}Q{)bY88q*)(xN0{yIXTS`KPQZ)jgRkS%F{iMsm$lb}Ijp@A zd=ovPzaG4k>U{2)a4i(0E?N|sqEP5gI!43O9s0+B^@7U-Og|cAyia310r`5`p^gI& zX~%$Z^=aT?^%>xx_8H8y5^_an7304Ie%Ry-EPKZMY5kYsTJC%FXieMM@OP_R!v%VNCcmC;XjRWkbcmLQ)AR>;*ej-k8aOr}d*+NO81qVXi?fp}`n)pImWHZ&l5d5$^64XZ4lfp7prM*I?Ny`l-*o z8NN!bq8EJbK57H^qR&08J&c~O_}q7~zE$+9&yC2qzx$jSR%m1!=iJYO1GiAuJZQq+(lBlcG<;293TW^H$__bQT$<85lygIg9i9 zPGA$Y3vLli2=)u!EO@J+0aRoGTj@^VB{jgI|?w=6a5VS;cROk~z zpAh;1p`Q`@jNnUxuZWy9)~p0$g6jo)1QUW|8e2Oiw4w35hS1Z3M+NT}JR$gi^f@K; z89@q&{enG$V}jFy_Y0m1@GPf%{(~kfj)uvPgSyV&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kE+7ED#qSUuEY zy^&~NV`GF1rjG<;6zyYZ;Z;XlWJoDmW>HB*B__*4mcyGoV*{HoauY^^Xk?;=p~O&* zDE}34Eq^%~(w2?bMsar`-*+T!7Woz#I%pT(=P2}JKN4N9XhnQ?-w#frkXKakW+d>sYTj*n{iBkEKX7v{=L zXPc4kZZkT&I?XMcjft-Dj;>DQ+VqwVV{>~~x6xsAr@P17uEEb-F}B__S;1}y5DGw) zjS8>rM2q_JnaVpsBY|LZebdWz{7Q*%q@E49}$iU>(&vjYb1!km*vxR`QVdaW1U z0WGtaKUd}dCG&WIzi7&TMND7ZC_zp*GjrtJZzrBxdWepAAAeZ{8mEPZDTUwE!_-H6 zLG|N*T6Tl)2X6QN*M*)AzVo4eR#)uAy=E0ebT9>0apL zJBjBgV?_oyq!^T5=`ArX6~%rqNlQgBt|>ejFS7UT>T5&7RWs`t zhCUk_tLtv3IP9-H1e^KyKYPxVzIeZcuc|9~JM+e|t}OnzY(gSevMH73d2;cCE zCg~t%Avxf~GVdN=&fe#FD}G?k^W=Xzzqc=g&|832CHT^ "[CS2-SimpleAdmin] Clean module"; + public override string ModuleDescription => "Module allows you to remove all weapons lying on the ground"; + public override string ModuleVersion => "v1.0.0"; + public override string ModuleAuthor => "daffyy"; + + private static ICS2_SimpleAdminApi? _sharedApi; + private readonly PluginCapability _pluginCapability = new("simpleadmin:api"); + + public override void OnAllPluginsLoaded(bool hotReload) + { + _sharedApi = _pluginCapability.Get(); + + if (_sharedApi == null) + { + Logger.LogError("CS2-SimpleAdmin SharedApi not found"); + Unload(false); + } + } + + [ConsoleCommand("css_clean")] + [ConsoleCommand("css_clear")] + [RequiresPermissions("@css/cheat")] + public void OnCleanCommand(CCSPlayerController? caller, CommandInfo commandInfo) + { + var weapons = Utilities.FindAllEntitiesByDesignerName("weapon_"); + var defusers = Utilities.FindAllEntitiesByDesignerName("item_cutters"); + + foreach (var weapon in weapons) + { + if (!weapon.IsValid || weapon.State != CSWeaponState_t.WEAPON_NOT_CARRIED) + continue; + + weapon.Remove(); + } + + foreach (var defuser in defusers) + { + if (!defuser.IsValid || defuser.OwnerEntity.Value != null) + continue; + + defuser.Remove(); + } + + _sharedApi?.LogCommand(caller, commandInfo); + } +} \ No newline at end of file diff --git "a/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.csproj" "b/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.csproj" new file mode 100644 index 0000000..1aac41c --- /dev/null +++ "b/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.csproj" @@ -0,0 +1,20 @@ + + + + net8.0 + CS2_SimpleAdmin_CleanModule + enable + enable + + + + + + + + + CS2-SimpleAdminApi.dll + + + + diff --git "a/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.sln" "b/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.sln" new file mode 100644 index 0000000..f9e05b4 --- /dev/null +++ "b/Modules/CS2-SimpleAdmin_ExampleModule \342\200\224 kopia/CS2-SimpleAdmin_CleanModule.sln" @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS2-SimpleAdmin_CleanModule", "CS2-SimpleAdmin_CleanModule.csproj", "{D940F3E9-0E3F-467A-B336-149E3A624FB6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D940F3E9-0E3F-467A-B336-149E3A624FB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D940F3E9-0E3F-467A-B336-149E3A624FB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D940F3E9-0E3F-467A-B336-149E3A624FB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D940F3E9-0E3F-467A-B336-149E3A624FB6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Modules/CS2-SimpleAdmin_ExampleModule/CS2-SimpleAdminApi.dll b/Modules/CS2-SimpleAdmin_ExampleModule/CS2-SimpleAdminApi.dll index c2dbdee66b66088a8c5ff7fa730a18f884167f3c..b7283c2ce01b88b33c2ac23f9b052051fb11fdbe 100644 GIT binary patch delta 3208 zcmZ{ne^6Xk701uLyYKDtYuR1c1;Vcdl8{P5m))>|8XYJgAq|m~5SlhIJYbWqU6urP zYtTs-8WW=?PVi->+Hq`<7&V$q309}pj#N8z{4pAxj8n&sLrB#8(Ke&)B-1*ze(%{w zjXFN&e(w36d(M6Ly?5Sy%jD+CmeVJypWXGbn`9kJR2|3>L84+f^o;X&k?9M&Tu(%Z zKCT=sL|1LoRRy^NM7hvs8i{tARdT(#ThwO1>W3?UR&0JjRJg9%V78#y(N>v15VfMh z{FA6Ixs2)5u?0<%MklL?oP|Wfyyo9z_DF~Dm=DPV!fP(bS#a34?IV*;qM9d&UPr%P z*}ciJSmMCAny1)9v>JU)UoUNj?N)YYUspT&ZO}h9->}t|S3qfKJ~S1rnitK5w$*H~ zSEki^iSjkUy-wBk23@C9%uTl2T0R}cZP6)dd(IBpJ2aiH*c4AOFEH-FTiYikY3QUserx=zM}mjEp>7r)J1D)0?Wz;bqaIBFQrN=!xY(cUdzIy z8#Lv)?NAfl(n5}G`kD+m)XKYf`2r`I!L7J$zhlR(Re!jy>++6$1UKCU?WX6nJN84A zWvTQrmW6nP5z28MAzeR2$7t7NNIL;$GmC7>p0g{Sk%}|$S5c=p2|gx|f%U=!9~V!7 zJ@P4>ssw&P%R=#=%%3qgvj4nz8vc`M@pW|j#5Z{TM2p&G?L0i0V^RB!{UTPrqJHbR zTm6XU?iyQmJpXT%_dZ?W5>%Osc|LK4%OIl`>CY>rPU*$GYmj^oRj5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