mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 02:41:55 +00:00
New commands, addban and unban
This commit is contained in:
13
Helper.cs
13
Helper.cs
@@ -3,6 +3,7 @@ using CounterStrikeSharp.API;
|
||||
using MySqlConnector;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CS2_SimpleAdmin
|
||||
{
|
||||
@@ -15,6 +16,18 @@ namespace CS2_SimpleAdmin
|
||||
return Utilities.GetPlayers().FindAll(x => x.PlayerName.Contains(name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
public static List<CCSPlayerController> GetPlayerFromSteamid64(string steamid)
|
||||
{
|
||||
return Utilities.GetPlayers().FindAll(x => x.AuthorizedSteamID!.SteamId64.ToString().Equals(steamid));
|
||||
}
|
||||
|
||||
public static bool IsValidSteamID64(string input)
|
||||
{
|
||||
string pattern = @"^\d{17}$";
|
||||
|
||||
return Regex.IsMatch(input, pattern);
|
||||
}
|
||||
|
||||
public static TargetResult GetTarget(string target, out CCSPlayerController? player)
|
||||
{
|
||||
player = null;
|
||||
|
||||
Reference in New Issue
Block a user