Compare commits

..

12 Commits

Author SHA1 Message Date
Dawid Bepierszcz
1d65d4be78 Update VERSION 2025-10-02 02:08:06 +02:00
Dawid Bepierszcz
ca61d8b79a Updated API 2025-09-22 21:39:11 +02:00
Dawid Bepierszcz
4e578747e3 Delete CS2-SimpleAdminApi/QAngle_t.cs 2025-09-22 21:38:53 +02:00
Dawid Bepierszcz
a643f7aea9 Delete CS2-SimpleAdminApi/Vector_t.cs 2025-09-22 21:38:45 +02:00
Dawid Bepierszcz
8e9f10132f Update VERSION 2025-09-22 21:38:00 +02:00
Dawid Bepierszcz
3e19408416 StealthModule 2025-09-22 21:33:52 +02:00
Dawid Bepierszcz
d25056864d Update VERSION 2025-09-03 23:57:02 +02:00
Dawid Bepierszcz
6e3a328344 Update VERSION 2025-08-24 00:24:08 +02:00
Dawid Bepierszcz
b0bf000b96 Update VERSION 2025-08-15 14:21:02 +02:00
Dawid Bepierszcz
fdcb47330f Update VERSION 2025-08-11 00:48:01 +02:00
Dawid Bepierszcz
d8b7a46519 Update VERSION 2025-08-09 19:19:24 +02:00
Dawid Bepierszcz
38f1f0c782 Add files via upload 2025-08-07 11:28:01 +02:00
8 changed files with 101 additions and 1 deletions

View File

@@ -1 +1 @@
1.7.7-alpha-2
1.7.7-alpha-9

View File

@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>CS2_SimpleAdminApi</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.340" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4-beta1" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,33 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Capabilities;
using CounterStrikeSharp.API.Modules.Commands;
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?, int?>? OnPlayerPenaltied;
public event Action<SteamID, PlayerInfo?, PenaltyType, string, int, int?, int?>? OnPlayerPenaltiedAdded;
public event Action<string, string?, bool, object>? OnAdminShowActivity;
public event Action<int, bool>? OnAdminToggleSilent;
public void IssuePenalty(CCSPlayerController player, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1);
public void IssuePenalty(SteamID steamid, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1);
public void LogCommand(CCSPlayerController? caller, string command);
public void LogCommand(CCSPlayerController? caller, CommandInfo command);
public void ShowAdminActivity(string messageKey, string? callerName = null, bool dontPublish = false, params object[] messageArgs);
public bool IsAdminSilent(CCSPlayerController player);
public HashSet<int> ListSilentAdminsSlots();
}

View File

@@ -0,0 +1,11 @@
namespace CS2_SimpleAdminApi;
public enum PenaltyType
{
Ban = 0,
Kick,
Mute,
Gag,
Silence,
Warn
}

View File

@@ -0,0 +1,40 @@
using System.Numerics;
using CounterStrikeSharp.API.Modules.Entities;
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 bool WaitingForKick { get; set; } = false;
public List<(ulong SteamId, string PlayerName)> AccountsAssociated { get; set; } = [];
public DiePosition? DiePosition { get; set; }
public bool IsLoaded { get; set; }
}
public class DiePosition(Vector3 position, Vector3 angle)
{
public Vector3 Position { get; } = position;
public Vector3 Angle { get; } = angle;
}