├── README.md ├── Source Code ├── PluginCommandsBlocker.cs └── PluginCommandsBlocker.csproj └── csgo └── addons └── counterstrikesharp └── plugins └── PluginCommandsBlocker ├── PluginCommandsBlocker.deps.json ├── PluginCommandsBlocker.dll └── PluginCommandsBlocker.pdb /README.md: -------------------------------------------------------------------------------- 1 | # [Plugin Commands Blocker] 2 | ## About 3 | With the Plugin Commands Blocker plugin installed, and running on your server. 4 | Players will no longer be able to use commands in their player console in order to acquire information regarding your server's metamod or sourcemod version, nor the loaded plugins and modules. 5 | Nor will administrators with the generic administrator access flag be able to view a list of your server's CounterStrikeSharp plugins. 6 | Only administrators with the Root permission will be able to do this. 7 | 8 | 9 | ## Disclaimer 10 | I am aware that this is a controversial type of plugin, and many may dislike the features that it provides. Personally, I am not partial for, nor against it. 11 | But unlike other versions that I have seen in the past, this plugin will not send insults or treat the client in a hostile fashion. 12 | This plugin is bound to be created, by somebody eventually, and by creating this myself I hope to at least provide a more civilized solution. 13 | 14 | 15 | ## Requirements 16 | In order for the plugin to work, you must have the following installed: 17 | - [CounterStrikeSharp](https://docs.cssharp.dev/guides/getting-started/) 18 | 19 | 20 | ## Installation 21 | To install this on your server do the following: 22 | 1). Download the contents and open the downloaded zip file. 23 | 2). Drag the files within the 'csgo' folder into your server's csgo/ directory. 24 | 3). Restart the server. 25 | 26 | 27 | ## Known Bugs & Issues 28 | - None. 29 | 30 | 31 | ## Future development plans 32 | - [ ] Fix any bugs/issues that get reported. 33 | 34 | 35 | ## Bug Reports, Problems & Help 36 | This plugin has been tested and used on a server, there should be no bugs or issues aside from the known ones found here. 37 | Should you run into a bug that isn't listed here, then please report it by creating an issue here on GitHub. 38 | -------------------------------------------------------------------------------- /Source Code/PluginCommandsBlocker.cs: -------------------------------------------------------------------------------- 1 | ///////////////// 2 | // - IMPORTS - // 3 | ///////////////// 4 | 5 | // C# Specific imports 6 | using System; 7 | 8 | // CSSharp specific imports 9 | using CounterStrikeSharp.API; 10 | using CounterStrikeSharp.API.Core; 11 | 12 | // Required for being able to use attributes for commands and defining minimum api versions 13 | using CounterStrikeSharp.API.Core.Attributes; 14 | 15 | // Required for being able to check a users administrator permissions 16 | using CounterStrikeSharp.API.Modules.Admin; 17 | 18 | // Required for being able to use attribute based command setup 19 | using CounterStrikeSharp.API.Modules.Commands; 20 | using CounterStrikeSharp.API.Core.Attributes.Registration; 21 | 22 | // Required for using chat colors in messages amongst many other things 23 | using CounterStrikeSharp.API.Modules.Utils; 24 | 25 | 26 | // Specifies the namespace of the plugin, this should match the name of the plugin file 27 | namespace PluginCommandsBlocker; 28 | 29 | // Defines the minimum version of CounterStrikeSharp required in order to run this plugin on the server 30 | [MinimumApiVersion(96)] 31 | 32 | // Specifies our main class, this should match the name of the namespace 33 | public class PluginCommandsBlocker : BasePlugin 34 | { 35 | // The retrievable information about the plugin itself 36 | public override string ModuleName => "[Custom] Plugin Commands Blocker"; 37 | public override string ModuleAuthor => "Manifest @Road To Glory"; 38 | public override string ModuleDescription => "Prevents players from accessing your server's plugin information through the player console."; 39 | public override string ModuleVersion => "V. 1.0.1 [Beta]"; 40 | 41 | 42 | // Multi-colored clan tag and predefined chat colors 43 | private string ChatPrefix = $"[{ChatColors.Lime}Server{ChatColors.White}]"; 44 | private string ChatColorHighlight = $"{ChatColors.Lime}"; 45 | private string ChatColorNormal = $"{ChatColors.White}"; 46 | 47 | 48 | // This happens when the plugin is loaded 49 | public override void Load(bool hotReload) 50 | { 51 | // Adds a command listener to track the usage of the specified command 52 | AddCommandListener("sm", CommandListener_BlockOutput); 53 | AddCommandListener("meta", CommandListener_BlockOutput); 54 | AddCommandListener("css_plugins", CommandListener_BlockOutput); 55 | } 56 | 57 | 58 | // This happens when the meta command is being used 59 | private HookResult CommandListener_BlockOutput(CCSPlayerController? player, CommandInfo info) 60 | { 61 | // If the CCSPlayerController is null then execute this section 62 | if (player == null) 63 | { 64 | return HookResult.Continue; 65 | } 66 | 67 | // If the the CCSPlayerController entity is invalid by pointing to a null pointer then execute this section 68 | if (!player.IsValid) 69 | { 70 | return HookResult.Continue; 71 | } 72 | 73 | // If the pawn associated with the CCSPlayerController is invalid then execute this section 74 | if (!player.PlayerPawn.IsValid) 75 | { 76 | return HookResult.Continue; 77 | } 78 | 79 | // If the player has root administrator permissions then execute this section 80 | if (AdminManager.PlayerHasPermissions(player, "@css/root")) 81 | { 82 | return HookResult.Continue; 83 | } 84 | 85 | // Sends a message in the player's chat area which can only be seen by that specific player 86 | player.PrintToChat($"{ChatPrefix} The {ChatColorHighlight}plugin commands{ChatColorNormal} are not accessible to the public."); 87 | player.PrintToChat($"- Contact the {ChatColorHighlight}server's staff team{ChatColorNormal} if you have any questions."); 88 | 89 | return HookResult.Stop; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Source Code/PluginCommandsBlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | YOUR PATH HERE/CounterStrikeSharp.API.dll 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /csgo/addons/counterstrikesharp/plugins/PluginCommandsBlocker/PluginCommandsBlocker.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v7.0", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v7.0": { 9 | "PluginCommandsBlocker/1.0.0": { 10 | "dependencies": { 11 | "CounterStrikeSharp.API": "1.0.96.0" 12 | }, 13 | "runtime": { 14 | "PluginCommandsBlocker.dll": {} 15 | } 16 | }, 17 | "CounterStrikeSharp.API/1.0.96.0": { 18 | "runtime": { 19 | "CounterStrikeSharp.API.dll": { 20 | "assemblyVersion": "1.0.96.0", 21 | "fileVersion": "1.0.96.0" 22 | } 23 | } 24 | } 25 | } 26 | }, 27 | "libraries": { 28 | "PluginCommandsBlocker/1.0.0": { 29 | "type": "project", 30 | "serviceable": false, 31 | "sha512": "" 32 | }, 33 | "CounterStrikeSharp.API/1.0.96.0": { 34 | "type": "reference", 35 | "serviceable": false, 36 | "sha512": "" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /csgo/addons/counterstrikesharp/plugins/PluginCommandsBlocker/PluginCommandsBlocker.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManifestManah/PluginsCommandsBlocker/589e4b475703eff5eb2520af1d0014028475fc12/csgo/addons/counterstrikesharp/plugins/PluginCommandsBlocker/PluginCommandsBlocker.dll -------------------------------------------------------------------------------- /csgo/addons/counterstrikesharp/plugins/PluginCommandsBlocker/PluginCommandsBlocker.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManifestManah/PluginsCommandsBlocker/589e4b475703eff5eb2520af1d0014028475fc12/csgo/addons/counterstrikesharp/plugins/PluginCommandsBlocker/PluginCommandsBlocker.pdb --------------------------------------------------------------------------------