mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 02:41:55 +00:00
1.6.0a
```diff
+ `Refactored Code`: Improved code structure for better maintainability.
+ `Player Penalties Command`: Introduced the `css_penalties` command to display player penalties.
+ `Admin Penalties Information`: Added functionality to provide information for admins regarding penalties of connecting players.
+ `Disconnected Players Command`: Added the `css_disconnected` command to show a list of disconnected players.
+ `Colorful Messages`: Implemented the `css_cssay` command to send colorful messages, e.g., `css_cssay {lightgreen}Test`.
+ `Respawn Functionality`: Updated the `css_respawn` command to respawn players at their death location.
+ `Menu Type Management`: Introduced the `css_menus` command to change the menu type via `MenuManagerCS2`.
+ `Dynamic Menu Control`: Enhanced menu interaction with dynamic controls using WASD + ER keys.
+ `Language File Updates`: Updated language files for better localization.
+ `API Integration`: Added a simple API for external interaction.
+ `Configurable Timezone`: Introduced timezone settings in the configuration.
+ `Admin Activity Display Options`: Added configurable settings for displaying admin activity:
+ `0`: Do not show
+ `1`: Hide admin name
+ `2`: Show admin name
+ `Discord Notification Customization`: Made Discord duration notifications customizable with `{relative}` and `{normal}` placeholders.
+ Improved command logging
+
`Configuration Options:`
+ `Timezone`
+ `Other Settings`
+ `Disconnected Players History Count`
+ `Show Activity Type`
```
This commit is contained in:
14
CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj
Normal file
14
CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>CS2_SimpleAdminApi</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.266" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
23
CS2-SimpleAdminApi/ICS2-SimpleAdminApi.cs
Normal file
23
CS2-SimpleAdminApi/ICS2-SimpleAdminApi.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core.Capabilities;
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
|
||||
namespace CS2_SimpleAdminApi;
|
||||
|
||||
public interface ICS2_SimpleAdminApi
|
||||
{
|
||||
public static readonly PluginCapability<ICS2_SimpleAdminApi?> PluginCapability = new("simpleadmin:api");
|
||||
|
||||
public PlayerInfo GetPlayerInfo(CCSPlayerController player);
|
||||
|
||||
public string GetConnectionString();
|
||||
public string GetServerAddress();
|
||||
public int? GetServerId();
|
||||
|
||||
public Dictionary<PenaltyType, List<(DateTime EndDateTime, int Duration, bool Passed)>> GetPlayerMuteStatus(CCSPlayerController player);
|
||||
|
||||
public event Action<PlayerInfo, PlayerInfo?, PenaltyType, string, int, int?>? OnPlayerPenaltied;
|
||||
public event Action<SteamID, PlayerInfo?, PenaltyType, string, int, int?>? OnPlayerPenaltiedAdded;
|
||||
|
||||
public void IssuePenalty(CCSPlayerController player, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1);
|
||||
}
|
||||
11
CS2-SimpleAdminApi/PenaltyType.cs
Normal file
11
CS2-SimpleAdminApi/PenaltyType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace CS2_SimpleAdminApi;
|
||||
|
||||
public enum PenaltyType
|
||||
{
|
||||
Ban = 0,
|
||||
Kick,
|
||||
Mute,
|
||||
Gag,
|
||||
Silence,
|
||||
Warn
|
||||
}
|
||||
35
CS2-SimpleAdminApi/PlayerInfo.cs
Normal file
35
CS2-SimpleAdminApi/PlayerInfo.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
|
||||
namespace CS2_SimpleAdminApi;
|
||||
|
||||
public class PlayerInfo(
|
||||
int? userId,
|
||||
int slot,
|
||||
SteamID steamId,
|
||||
string name,
|
||||
string? ipAddress,
|
||||
int totalBans = 0,
|
||||
int totalMutes = 0,
|
||||
int totalGags = 0,
|
||||
int totalSilences = 0,
|
||||
int totalWarns = 0)
|
||||
{
|
||||
public int? UserId { get; } = userId;
|
||||
public int Slot { get; } = slot;
|
||||
public SteamID SteamId { get; } = steamId;
|
||||
public string Name { get; } = name;
|
||||
public string? IpAddress { get; } = ipAddress;
|
||||
public int TotalBans { get; set; } = totalBans;
|
||||
public int TotalMutes { get; set; } = totalMutes;
|
||||
public int TotalGags { get; set; } = totalGags;
|
||||
public int TotalSilences { get; set; } = totalSilences;
|
||||
public int TotalWarns { get; set; } = totalWarns;
|
||||
public DiePosition? DiePosition { get; set; }
|
||||
}
|
||||
|
||||
public class DiePosition(Vector? position = null, QAngle? angle = null)
|
||||
{
|
||||
public Vector? Position { get; set; } = position;
|
||||
public QAngle? Angle { get; set; } = angle;
|
||||
}
|
||||
Reference in New Issue
Block a user