-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New give command - Added `@css/permmute` flag to allow perm penalties - Fixed mute when player silenced - Added CleanModule - allow to clean weapons on ground
- Loading branch information
Showing
17 changed files
with
193 additions
and
27 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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.6.3b | ||
1.6.4a |
Binary file not shown.
59 changes: 59 additions & 0 deletions
59
Modules/CS2-SimpleAdmin_ExampleModule — kopia/CS2-SimpleAdmin_CleanModule.cs
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,59 @@ | ||
using CounterStrikeSharp.API; | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Core.Attributes.Registration; | ||
using CounterStrikeSharp.API.Core.Capabilities; | ||
using CounterStrikeSharp.API.Modules.Admin; | ||
using CounterStrikeSharp.API.Modules.Commands; | ||
using CS2_SimpleAdminApi; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace CS2_SimpleAdmin_CleanModule; | ||
|
||
public class CS2_SimpleAdmin_CleanModule: BasePlugin | ||
{ | ||
public override string ModuleName => "[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<ICS2_SimpleAdminApi> _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<CCSWeaponBaseGun>("weapon_"); | ||
var defusers = Utilities.FindAllEntitiesByDesignerName<CSceneEntity>("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); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Modules/CS2-SimpleAdmin_ExampleModule — kopia/CS2-SimpleAdmin_CleanModule.csproj
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,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>CS2_SimpleAdmin_CleanModule</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.266" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="CS2-SimpleAdminApi"> | ||
<HintPath>CS2-SimpleAdminApi.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
</Project> |
16 changes: 16 additions & 0 deletions
16
Modules/CS2-SimpleAdmin_ExampleModule — kopia/CS2-SimpleAdmin_CleanModule.sln
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,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 |
Binary file modified
BIN
+512 Bytes
(110%)
Modules/CS2-SimpleAdmin_ExampleModule/CS2-SimpleAdminApi.dll
Binary file not shown.