Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruze03 authored Nov 8, 2023
0 parents commit 7624f63
Show file tree
Hide file tree
Showing 11 changed files with 219 additions and 0 deletions.
47 changes: 47 additions & 0 deletions BlockRadioCommands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace BlockRadioCommands;

using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Commands;

public class PluginInfo : BasePlugin
{
public override string ModuleName => "Block Radio Commands";
public override string ModuleVersion => "0.1";
public override string ModuleAuthor => "Cruze";
public override string ModuleDescription => "Blocks radio commands, player ping and chatwheel";

private string[] Commands = new string[] { "coverme", "takepoint", "holdpos", "regroup", "followme", "takingfire", "go", "fallback", "sticktog","getinpos", "stormfront", "report", "roger", "enemyspot", "needbackup", "sectorclear", "inposition", "reportingin","getout", "negative", "enemydown", "compliment", "thanks", "cheer", "go_a", "go_b", "sorry", "needrop", "playerradio", "playerchatwheel", "player_ping", "chatwheel_ping"};


public override void Load(bool hotReload)
{
for (int i = 0; i < Commands.Length; i++)
{
AddCommandListener(Commands[i], CommandListener_RadioCommands);
// Console.WriteLine($"Adding listener to {Commands[i]}");
}


Console.WriteLine("BlockRadioCommands is loaded");
}

private HookResult CommandListener_RadioCommands(CCSPlayerController? player, CommandInfo info)
{
Console.WriteLine($"Debug - {player.PlayerName} just tried {info.GetCommandString}");

// If the the CCSPlayerController entity is invalid then execute this section
if (!player.IsValid)
{
return HookResult.Continue;
}

// If the pawn associated with the CCSPlayerController is invalid then execute this section
if (!player.PlayerPawn.IsValid)
{
return HookResult.Continue;
}

return HookResult.Stop;
}
}
23 changes: 23 additions & 0 deletions BlockRadioCommands.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>

<Reference Include="CounterStrikeSharp.API">

<HintPath>CounterStrikeSharp.API.dll</HintPath>

</Reference>

</ItemGroup>

<ItemGroup>
<PackageReference Include="Nexd.MySQL" Version="1.0.1" />
</ItemGroup>

</Project>
73 changes: 73 additions & 0 deletions bin/Release/net7.0/BlockRadioCommands.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"BlockRadioCommands/1.0.0": {
"dependencies": {
"Nexd.MySQL": "1.0.1",
"CounterStrikeSharp.API": "1.0.5.0"
},
"runtime": {
"BlockRadioCommands.dll": {}
}
},
"MySqlConnector/2.2.7": {
"runtime": {
"lib/net7.0/MySqlConnector.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.2.7.0"
}
}
},
"Nexd.MySQL/1.0.1": {
"dependencies": {
"MySqlConnector": "2.2.7"
},
"runtime": {
"lib/net7.0/Nexd.MySQL.dll": {
"assemblyVersion": "1.0.1.0",
"fileVersion": "1.0.1.0"
}
}
},
"CounterStrikeSharp.API/1.0.5.0": {
"runtime": {
"CounterStrikeSharp.API.dll": {
"assemblyVersion": "1.0.5.0",
"fileVersion": "1.0.5.0"
}
}
}
}
},
"libraries": {
"BlockRadioCommands/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"MySqlConnector/2.2.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-rwFa71MlOJ142S+BXDvtLRdAIn7l6PTNWu+Xehs2qRehK8dckjKqwvK8azEADCMkQyXS1LXgh9HkSvItpTi6WA==",
"path": "mysqlconnector/2.2.7",
"hashPath": "mysqlconnector.2.2.7.nupkg.sha512"
},
"Nexd.MySQL/1.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Z7+FBaVDfXfz6jL8rP7nWmKCj1Zr6Qz31REh/cwH07c/QLfqBNUyDknUHF4GVdbYPfWV15M+dh1RxZLkoIL0KQ==",
"path": "nexd.mysql/1.0.1",
"hashPath": "nexd.mysql.1.0.1.nupkg.sha512"
},
"CounterStrikeSharp.API/1.0.5.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}
Binary file added bin/Release/net7.0/BlockRadioCommands.dll
Binary file not shown.
Binary file added bin/Release/net7.0/BlockRadioCommands.pdb
Binary file not shown.
Binary file added bin/Release/net7.0/CounterStrikeSharp.API.dll
Binary file not shown.
73 changes: 73 additions & 0 deletions bin/Release/net7.0/publish/BlockRadioCommands.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"BlockRadioCommands/1.0.0": {
"dependencies": {
"Nexd.MySQL": "1.0.1",
"CounterStrikeSharp.API": "1.0.5.0"
},
"runtime": {
"BlockRadioCommands.dll": {}
}
},
"MySqlConnector/2.2.7": {
"runtime": {
"lib/net7.0/MySqlConnector.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.2.7.0"
}
}
},
"Nexd.MySQL/1.0.1": {
"dependencies": {
"MySqlConnector": "2.2.7"
},
"runtime": {
"lib/net7.0/Nexd.MySQL.dll": {
"assemblyVersion": "1.0.1.0",
"fileVersion": "1.0.1.0"
}
}
},
"CounterStrikeSharp.API/1.0.5.0": {
"runtime": {
"CounterStrikeSharp.API.dll": {
"assemblyVersion": "1.0.5.0",
"fileVersion": "1.0.5.0"
}
}
}
}
},
"libraries": {
"BlockRadioCommands/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"MySqlConnector/2.2.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-rwFa71MlOJ142S+BXDvtLRdAIn7l6PTNWu+Xehs2qRehK8dckjKqwvK8azEADCMkQyXS1LXgh9HkSvItpTi6WA==",
"path": "mysqlconnector/2.2.7",
"hashPath": "mysqlconnector.2.2.7.nupkg.sha512"
},
"Nexd.MySQL/1.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Z7+FBaVDfXfz6jL8rP7nWmKCj1Zr6Qz31REh/cwH07c/QLfqBNUyDknUHF4GVdbYPfWV15M+dh1RxZLkoIL0KQ==",
"path": "nexd.mysql/1.0.1",
"hashPath": "nexd.mysql.1.0.1.nupkg.sha512"
},
"CounterStrikeSharp.API/1.0.5.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}
Binary file not shown.
Binary file added bin/Release/net7.0/publish/BlockRadioCommands.pdb
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions compile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
dotnet publish -f net7.0 -c Release
pause

0 comments on commit 7624f63

Please sign in to comment.