From 19a0923559189ff5114f49c90e96355001b4e43c Mon Sep 17 00:00:00 2001 From: Daniel Saewitz <990166+switz@users.noreply.github.com> Date: Wed, 8 Nov 2023 22:24:54 -0500 Subject: [PATCH] feat: Add Current API Version to css console command (#47) --- .../CounterStrikeSharp.API/Core/GlobalContext.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/managed/CounterStrikeSharp.API/Core/GlobalContext.cs b/managed/CounterStrikeSharp.API/Core/GlobalContext.cs index ba4c6c8e..7e3328fb 100644 --- a/managed/CounterStrikeSharp.API/Core/GlobalContext.cs +++ b/managed/CounterStrikeSharp.API/Core/GlobalContext.cs @@ -165,7 +165,7 @@ public void UnloadAllPlugins() private PluginContext? FindPluginByIdOrName(string query) { - + PluginContext? plugin = null; if (Int32.TryParse(query, out var pluginNumber)) { @@ -180,9 +180,12 @@ public void UnloadAllPlugins() private void OnCSSCommand(CCSPlayerController? caller, CommandInfo info) { + var currentVersion = Api.GetVersion(); + Utilities.ReplyToCommand(caller, " CounterStrikeSharp was created and is maintained by Michael \"roflmuffin\" Wilson.\n" + " Counter-Strike Sharp uses code borrowed from SourceMod, Source.Python, FiveM, Saul Rennison and CS2Fixes.\n" + - " See ACKNOWLEDGEMENTS.md for more information.", true); + " See ACKNOWLEDGEMENTS.md for more information.\n" + + " Current API Version: " + currentVersion, true); return; } @@ -206,7 +209,7 @@ private void OnCSSPluginCommand(CCSPlayerController? caller, CommandInfo info) sb.Append(plugin.Description); } Utilities.ReplyToCommand(caller, sb.ToString(), true); - + } break; @@ -231,7 +234,7 @@ private void OnCSSPluginCommand(CCSPlayerController? caller, CommandInfo info) { path = Path.Combine(rootDir.FullName, path); } - + try { LoadPlugin(path); @@ -240,7 +243,7 @@ private void OnCSSPluginCommand(CCSPlayerController? caller, CommandInfo info) { Console.WriteLine($"Failed to load plugin {path} with error {e}"); } - + break; }