New commands, addban and unban
This commit is contained in:
parent
53812148b3
commit
5ea71f1679
4 changed files with 128 additions and 2 deletions
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue