-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7624f63
Showing
11 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
dotnet publish -f net7.0 -c Release | ||
pause |