mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
1.2.5a
-Minor changes - Fixed `css_speed`
This commit is contained in:
39
Helper.cs
39
Helper.cs
@@ -1,9 +1,10 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Menu;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using CounterStrikeSharp.API.Modules.Menu;
|
||||
|
||||
namespace CS2_SimpleAdmin
|
||||
{
|
||||
@@ -46,6 +47,35 @@ namespace CS2_SimpleAdmin
|
||||
return Regex.IsMatch(input, pattern);
|
||||
}
|
||||
|
||||
public static void GivePlayerFlags(CCSPlayerController player, dynamic flags)
|
||||
{
|
||||
if (player == null) return;
|
||||
|
||||
foreach (var flagsValue in flags)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(flagsValue))
|
||||
{
|
||||
string[] _flags = flagsValue.Split(',');
|
||||
Console.WriteLine(flagsValue);
|
||||
|
||||
foreach (var _flag in _flags)
|
||||
{
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
if (_flag.StartsWith("@"))
|
||||
{
|
||||
AdminManager.AddPlayerPermissions(player, _flag);
|
||||
}
|
||||
if (_flag.StartsWith("#"))
|
||||
{
|
||||
AdminManager.AddPlayerToGroup(player, _flag);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public static TargetResult GetTarget(string target, out CCSPlayerController? player)
|
||||
{
|
||||
@@ -105,6 +135,5 @@ namespace CS2_SimpleAdmin
|
||||
if (CS2_SimpleAdmin.voteInProgress)
|
||||
CS2_SimpleAdmin.voteAnswers[option.Text]++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user