mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-03-04 22:54:54 +00:00
Compare commits
6 Commits
bc35e1d744
...
cf6d58812f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf6d58812f | ||
|
|
7154843d1d | ||
|
|
c42d2ddeeb | ||
|
|
7a69c5387a | ||
|
|
84646e4451 | ||
|
|
94e0013cf9 |
@@ -19,7 +19,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||
public override string ModuleAuthor => "daffyy & Dliix66";
|
||||
public override string ModuleVersion => "1.6.5a";
|
||||
public override string ModuleVersion => "1.6.7a";
|
||||
|
||||
public override void Load(bool hotReload)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.276" />
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.284" />
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="MySqlConnector" Version="2.3.7" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="*" />
|
||||
|
||||
@@ -77,7 +77,8 @@ public static class RegisterCommands
|
||||
new CommandMapping("css_prename", CS2_SimpleAdmin.Instance.OnPrenameCommand),
|
||||
new CommandMapping("css_respawn", CS2_SimpleAdmin.Instance.OnRespawnCommand),
|
||||
new CommandMapping("css_tp", CS2_SimpleAdmin.Instance.OnGotoCommand),
|
||||
new CommandMapping("css_bring", CS2_SimpleAdmin.Instance.OnBringCommand)
|
||||
new CommandMapping("css_bring", CS2_SimpleAdmin.Instance.OnBringCommand),
|
||||
new CommandMapping("css_pluginsmanager", CS2_SimpleAdmin.Instance.OnPluginManagerCommand)
|
||||
];
|
||||
|
||||
public static void InitializeCommands()
|
||||
@@ -158,7 +159,8 @@ public static class RegisterCommands
|
||||
{ "css_prename", new Command { Aliases = ["css_prename"] } },
|
||||
{ "css_respawn", new Command { Aliases = ["css_respawn"] } },
|
||||
{ "css_tp", new Command { Aliases = ["css_tp", "css_tpto", "css_goto"] } },
|
||||
{ "css_bring", new Command { Aliases = ["css_bring", "css_tphere"] } }
|
||||
{ "css_bring", new Command { Aliases = ["css_bring", "css_tphere"] } },
|
||||
{ "css_pluginsmanager", new Command { Aliases = ["css_pluginsmanager", "css_pluginmanager"] } }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections;
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core.Translations;
|
||||
@@ -13,6 +14,9 @@ using CS2_SimpleAdminApi;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using CounterStrikeSharp.API.Core.Attributes.Registration;
|
||||
using MenuManager;
|
||||
|
||||
namespace CS2_SimpleAdmin;
|
||||
|
||||
@@ -890,6 +894,76 @@ public partial class CS2_SimpleAdmin
|
||||
RestartGame(caller);
|
||||
}
|
||||
|
||||
[RequiresPermissions("@css/root")]
|
||||
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
|
||||
public void OnPluginManagerCommand(CCSPlayerController? caller, CommandInfo commandInfo)
|
||||
{
|
||||
if (MenuApi == null || caller == null)
|
||||
return;
|
||||
|
||||
var pluginManager = Helper.GetPluginManager();
|
||||
if (pluginManager == null)
|
||||
{
|
||||
Logger.LogError("Unable to access PluginManager.");
|
||||
return;
|
||||
}
|
||||
|
||||
var getLoadedPluginsMethod = pluginManager.GetType().GetMethod("GetLoadedPlugins", BindingFlags.Public | BindingFlags.Instance);
|
||||
if (getLoadedPluginsMethod?.Invoke(pluginManager, null) is not IEnumerable plugins)
|
||||
{
|
||||
Logger.LogError("Unable to retrieve plugins.");
|
||||
return;
|
||||
}
|
||||
|
||||
var pluginsMenu = Helper.CreateMenu(Localizer["sa_menu_pluginsmanager_title"]);
|
||||
|
||||
foreach (var plugin in plugins)
|
||||
{
|
||||
var pluginType = plugin.GetType();
|
||||
|
||||
// Accessing each property with the Type of the plugin
|
||||
var pluginId = pluginType.GetProperty("PluginId")?.GetValue(plugin);
|
||||
var state = pluginType.GetProperty("State")?.GetValue(plugin)?.ToString();
|
||||
var path = pluginType.GetProperty("FilePath")?.GetValue(plugin)?.ToString();
|
||||
path = Path.GetFileName(Path.GetDirectoryName(path));
|
||||
|
||||
// Access nested properties within "Plugin" (like ModuleName, ModuleVersion, etc.)
|
||||
var nestedPlugin = pluginType.GetProperty("Plugin")?.GetValue(plugin);
|
||||
if (nestedPlugin == null) continue;
|
||||
|
||||
var status = state?.ToUpper() != "UNLOADED" ? "ON" : "OFF";
|
||||
var allowedMenuTypes = new[] { "chat", "console" };
|
||||
|
||||
if (!allowedMenuTypes.Contains(Config.MenuConfigs.MenuType) && MenuApi.GetMenuType(caller) >= MenuType.CenterMenu)
|
||||
status = state?.ToUpper() != "UNLOADED" ? "<font color='lime'>ON</font>" : "<font color='red'>OFF</font>";
|
||||
var nestedType = nestedPlugin.GetType();
|
||||
var moduleName = nestedType.GetProperty("ModuleName")?.GetValue(nestedPlugin)?.ToString() ?? "Unknown";
|
||||
var moduleVersion = nestedType.GetProperty("ModuleVersion")?.GetValue(nestedPlugin)?.ToString();
|
||||
// var moduleAuthor = nestedType.GetProperty("ModuleAuthor")?.GetValue(nestedPlugin)?.ToString();
|
||||
// var moduleDescription = nestedType.GetProperty("ModuleDescription")?.GetValue(nestedPlugin)?.ToString();
|
||||
|
||||
pluginsMenu?.AddMenuOption($"({status}) [{moduleName} {moduleVersion}]", (_, _) =>
|
||||
{
|
||||
if (state?.ToUpper() != "UNLOADED")
|
||||
{
|
||||
caller.SendLocalizedMessage(Localizer, "sa_menu_pluginsmanager_unloaded", moduleName);
|
||||
Server.ExecuteCommand($"css_plugins unload {pluginId}");
|
||||
}
|
||||
else
|
||||
{
|
||||
caller.SendLocalizedMessage(Localizer, "sa_menu_pluginsmanager_loaded", moduleName);
|
||||
Server.ExecuteCommand($"css_plugins load {path}");
|
||||
}
|
||||
|
||||
AddTimer(0.1f, () => OnPluginManagerCommand(caller, commandInfo));
|
||||
});
|
||||
|
||||
// Console.WriteLine($"[#{pluginId}:{state?.ToUpper()}]: \"{moduleName ?? "Unknown"}\" ({moduleVersion ?? "Unknown"}) by {moduleAuthor}");
|
||||
}
|
||||
|
||||
pluginsMenu?.Open(caller);
|
||||
}
|
||||
|
||||
public static void RestartGame(CCSPlayerController? admin)
|
||||
{
|
||||
Helper.LogCommand(admin, "css_restartgame");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Globalization;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core.Attributes.Registration;
|
||||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Commands;
|
||||
using CounterStrikeSharp.API.Modules.Entities.Constants;
|
||||
@@ -10,6 +10,9 @@ namespace CS2_SimpleAdmin;
|
||||
|
||||
public partial class CS2_SimpleAdmin
|
||||
{
|
||||
internal static readonly Dictionary<int, float> SpeedPlayers = [];
|
||||
internal static readonly Dictionary<CCSPlayerController, float> GravityPlayers = [];
|
||||
|
||||
[RequiresPermissions("@css/slay")]
|
||||
[CommandHelper(minArgs: 1, usage: "<#userid or name>", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
||||
public void OnSlayCommand(CCSPlayerController? caller, CommandInfo command)
|
||||
@@ -265,8 +268,7 @@ public partial class CS2_SimpleAdmin
|
||||
[CommandHelper(minArgs: 1, usage: "<#userid or name> <speed>", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
||||
public void OnSpeedCommand(CCSPlayerController? caller, CommandInfo command)
|
||||
{
|
||||
var callerName = caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName;
|
||||
float.TryParse(command.GetArg(2), out var speed);
|
||||
float.TryParse(command.GetArg(2), NumberStyles.Float, CultureInfo.InvariantCulture, out var speed);
|
||||
|
||||
var targets = GetTarget(command);
|
||||
if (targets == null) return;
|
||||
@@ -294,6 +296,11 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
// Set player's speed
|
||||
player.SetSpeed(speed);
|
||||
|
||||
if (speed == 1f)
|
||||
SpeedPlayers.Remove(player.Slot);
|
||||
else
|
||||
SpeedPlayers[player.Slot] = speed;
|
||||
|
||||
// Log the command
|
||||
if (command == null)
|
||||
@@ -313,14 +320,12 @@ public partial class CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_gravity")]
|
||||
[RequiresPermissions("@css/slay")]
|
||||
[CommandHelper(minArgs: 1, usage: "<#userid or name> <gravity>", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
||||
public void OnGravityCommand(CCSPlayerController? caller, CommandInfo command)
|
||||
{
|
||||
var callerName = caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName;
|
||||
float.TryParse(command.GetArg(2), out var gravity);
|
||||
|
||||
float.TryParse(command.GetArg(2), NumberStyles.Float, CultureInfo.InvariantCulture, out var gravity);
|
||||
|
||||
var targets = GetTarget(command);
|
||||
if (targets == null) return;
|
||||
|
||||
@@ -347,7 +352,12 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
// Set player's gravity
|
||||
player.SetGravity(gravity);
|
||||
|
||||
|
||||
if (gravity == 1f)
|
||||
GravityPlayers.Remove(player);
|
||||
else
|
||||
GravityPlayers[player] = gravity;
|
||||
|
||||
// Log the command
|
||||
if (command == null)
|
||||
Helper.LogCommand(caller, $"css_gravity {(string.IsNullOrEmpty(player.PlayerName) ? player.SteamID.ToString() : player.PlayerName)} {gravity}");
|
||||
@@ -452,7 +462,7 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
// Set default caller name if not provided
|
||||
var callerName = caller != null ? caller.PlayerName : _localizer?["sa_console"] ?? "Console";
|
||||
|
||||
|
||||
// Apply slap damage to the player
|
||||
player.Pawn.Value?.Slap(damage);
|
||||
|
||||
|
||||
@@ -221,6 +221,9 @@ public class OtherSettings
|
||||
|
||||
[JsonPropertyName("ShowBanMenuIfNoTime")]
|
||||
public bool ShowBanMenuIfNoTime { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("UserMessageGagChatType")]
|
||||
public bool UserMessageGagChatType { get; set; } = false;
|
||||
}
|
||||
|
||||
public class CS2_SimpleAdminConfig : BasePluginConfig
|
||||
|
||||
@@ -10,6 +10,7 @@ using CS2_SimpleAdminApi;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text;
|
||||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.UserMessages;
|
||||
|
||||
namespace CS2_SimpleAdmin;
|
||||
|
||||
@@ -17,31 +18,33 @@ public partial class CS2_SimpleAdmin
|
||||
{
|
||||
private void RegisterEvents()
|
||||
{
|
||||
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
||||
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
||||
RegisterListener<Listeners.OnGameServerSteamAPIActivated>(OnGameServerSteamAPIActivated);
|
||||
AddCommandListener(null, OnCommandSayNew);
|
||||
AddCommandListener("callvote", OnCommandCallVote);
|
||||
if (Config.OtherSettings.UserMessageGagChatType)
|
||||
HookUserMessage(118, HookUmChat);
|
||||
|
||||
AddCommandListener(null, ComamndListenerHandler);
|
||||
// AddCommandListener("callvote", OnCommandCallVote);
|
||||
// AddCommandListener("say", OnCommandSay);
|
||||
// AddCommandListener("say_team", OnCommandTeamSay);
|
||||
}
|
||||
|
||||
private HookResult OnCommandCallVote(CCSPlayerController? caller, CommandInfo info)
|
||||
{
|
||||
var voteType = info.GetArg(1).ToLower();
|
||||
|
||||
if (voteType != "kick")
|
||||
return HookResult.Continue;
|
||||
|
||||
var target = int.TryParse(info.GetArg(2), out var userId)
|
||||
? Utilities.GetPlayerFromUserid(userId)
|
||||
: null;
|
||||
|
||||
if (target == null || !target.IsValid || target.Connected != PlayerConnectedState.PlayerConnected)
|
||||
return HookResult.Continue;
|
||||
|
||||
return !AdminManager.CanPlayerTarget(caller, target) ? HookResult.Stop : HookResult.Continue;
|
||||
}
|
||||
|
||||
// private HookResult OnCommandCallVote(CCSPlayerController? caller, CommandInfo info)
|
||||
// {
|
||||
// var voteType = info.GetArg(1).ToLower();
|
||||
//
|
||||
// if (voteType != "kick")
|
||||
// return HookResult.Continue;
|
||||
//
|
||||
// var target = int.TryParse(info.GetArg(2), out var userId)
|
||||
// ? Utilities.GetPlayerFromUserid(userId)
|
||||
// : null;
|
||||
//
|
||||
// if (target == null || !target.IsValid || target.Connected != PlayerConnectedState.PlayerConnected)
|
||||
// return HookResult.Continue;
|
||||
//
|
||||
// return !AdminManager.CanPlayerTarget(caller, target) ? HookResult.Stop : HookResult.Continue;
|
||||
// }
|
||||
|
||||
private void OnGameServerSteamAPIActivated()
|
||||
{
|
||||
@@ -88,7 +91,9 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
SilentPlayers.Remove(player.Slot);
|
||||
GodPlayers.Remove(player.Slot);
|
||||
|
||||
SpeedPlayers.Remove(player.Slot);
|
||||
GravityPlayers.Remove(player);
|
||||
|
||||
if (player.UserId.HasValue)
|
||||
PlayersInfo.Remove(player.UserId.Value);
|
||||
|
||||
@@ -123,13 +128,16 @@ public partial class CS2_SimpleAdmin
|
||||
}
|
||||
|
||||
[GameEventHandler]
|
||||
public HookResult OnRoundEnd(EventRoundStart @event, GameEventInfo info)
|
||||
public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info)
|
||||
{
|
||||
#if DEBUG
|
||||
Logger.LogCritical("[OnRoundEnd]");
|
||||
#endif
|
||||
|
||||
GodPlayers.Clear();
|
||||
SpeedPlayers.Clear();
|
||||
GravityPlayers.Clear();
|
||||
|
||||
foreach (var player in PlayersInfo.Values)
|
||||
{
|
||||
player.DiePosition = null;
|
||||
@@ -153,22 +161,57 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
private HookResult HookUmChat(UserMessage um)
|
||||
{
|
||||
var author = Utilities.GetPlayerFromIndex(um.ReadInt("entityindex"));
|
||||
if (author == null || !author.IsValid || author.IsBot)
|
||||
return HookResult.Continue;
|
||||
|
||||
if (PlayerPenaltyManager.IsPenalized(author.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(author.Slot, PenaltyType.Silence))
|
||||
return HookResult.Stop;
|
||||
|
||||
private HookResult OnCommandSayNew(CCSPlayerController? player, CommandInfo info)
|
||||
// um.Recipients.Clear();
|
||||
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
private HookResult ComamndListenerHandler(CCSPlayerController? player, CommandInfo info)
|
||||
{
|
||||
if (player == null || !player.IsValid || player.IsBot)
|
||||
return HookResult.Continue;
|
||||
|
||||
var command = info.GetArg(0).ToLower();
|
||||
|
||||
if (command == "css_admins_reload")
|
||||
switch (command)
|
||||
{
|
||||
AddTimer(1.0f, () => ReloadAdmins(null));
|
||||
return HookResult.Continue;
|
||||
case "css_admins_reload":
|
||||
AddTimer(1.0f, () => ReloadAdmins(null));
|
||||
return HookResult.Continue;
|
||||
case "callvote":
|
||||
{
|
||||
var voteType = info.GetArg(1).ToLower();
|
||||
|
||||
if (voteType != "kick")
|
||||
return HookResult.Continue;
|
||||
|
||||
var target = int.TryParse(info.GetArg(2), out var userId)
|
||||
? Utilities.GetPlayerFromUserid(userId)
|
||||
: null;
|
||||
|
||||
if (target == null || !target.IsValid || target.Connected != PlayerConnectedState.PlayerConnected)
|
||||
return HookResult.Continue;
|
||||
|
||||
return !AdminManager.CanPlayerTarget(player, target) ? HookResult.Stop : HookResult.Continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!command.Contains("say"))
|
||||
return HookResult.Continue;
|
||||
|
||||
if (!Config.OtherSettings.UserMessageGagChatType)
|
||||
if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
|
||||
return HookResult.Stop;
|
||||
|
||||
if (info.GetArg(1).StartsWith($"/")
|
||||
|| info.GetArg(1).StartsWith($"!"))
|
||||
@@ -177,13 +220,14 @@ public partial class CS2_SimpleAdmin
|
||||
if (info.GetArg(1).Length == 0)
|
||||
return HookResult.Stop;
|
||||
|
||||
if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
|
||||
return HookResult.Stop;
|
||||
|
||||
if (command == "say" && info.GetArg(1).StartsWith($"@") &&
|
||||
AdminManager.PlayerHasPermissions(player, "@css/chat"))
|
||||
AdminManager.PlayerHasPermissions(player, "@vip/chat"))
|
||||
{
|
||||
player.ExecuteClientCommandFromServer($"css_say {info.GetArg(1).Remove(0, 1)}");
|
||||
sb.Append(_localizer!["sa_vipchat_template", player.PlayerName, info.GetArg(1).Remove(0, 1)]);
|
||||
foreach (var p in Utilities.GetPlayers().Where(p => p.IsValid && p is { IsBot: false, IsHLTV: false } && AdminManager.PlayerHasPermissions(p, "@vip/chat")))
|
||||
{
|
||||
p.PrintToChat(sb.ToString());
|
||||
}
|
||||
return HookResult.Stop;
|
||||
}
|
||||
|
||||
@@ -282,6 +326,8 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
GodPlayers.Clear();
|
||||
SilentPlayers.Clear();
|
||||
SpeedPlayers.Clear();
|
||||
GravityPlayers.Clear();
|
||||
|
||||
PlayerPenaltyManager.RemoveAllPenalties();
|
||||
}
|
||||
@@ -294,6 +340,9 @@ public partial class CS2_SimpleAdmin
|
||||
if (player is null || @event.Attacker is null || !player.PawnIsAlive || player.PlayerPawn.Value == null)
|
||||
return HookResult.Continue;
|
||||
|
||||
if (SpeedPlayers.TryGetValue(player.Slot, out var speedPlayer))
|
||||
player.SetSpeed(speedPlayer);
|
||||
|
||||
if (!GodPlayers.Contains(player.Slot)) return HookResult.Continue;
|
||||
|
||||
player.PlayerPawn.Value.Health = player.PlayerPawn.Value.MaxHealth;
|
||||
@@ -310,6 +359,9 @@ public partial class CS2_SimpleAdmin
|
||||
if (player?.UserId == null || player.IsBot || player.Connected != PlayerConnectedState.PlayerConnected)
|
||||
return HookResult.Continue;
|
||||
|
||||
SpeedPlayers.Remove(player.Slot);
|
||||
GravityPlayers.Remove(player);
|
||||
|
||||
PlayersInfo[player.UserId.Value].DiePosition =
|
||||
new DiePosition(
|
||||
new Vector(player.PlayerPawn.Value?.AbsOrigin?.X, player.PlayerPawn.Value?.AbsOrigin?.Y,
|
||||
|
||||
@@ -6,6 +6,7 @@ using CounterStrikeSharp.API.Modules.Entities;
|
||||
using CounterStrikeSharp.API.Modules.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Text;
|
||||
using CounterStrikeSharp.API.Modules.UserMessages;
|
||||
using Vector = CounterStrikeSharp.API.Modules.Utils.Vector;
|
||||
|
||||
namespace CS2_SimpleAdmin;
|
||||
@@ -93,8 +94,8 @@ public static class PlayerExtensions
|
||||
|
||||
public static void Freeze(this CBasePlayerPawn pawn)
|
||||
{
|
||||
pawn.MoveType = MoveType_t.MOVETYPE_OBSOLETE;
|
||||
Schema.SetSchemaValue(pawn.Handle, "CBaseEntity", "m_nActualMoveType", 1); // obsolete
|
||||
pawn.MoveType = MoveType_t.MOVETYPE_INVALID;
|
||||
Schema.SetSchemaValue(pawn.Handle, "CBaseEntity", "m_nActualMoveType", 11); // invalid
|
||||
Utilities.SetStateChanged(pawn, "CBaseEntity", "m_MoveType");
|
||||
}
|
||||
|
||||
@@ -171,6 +172,8 @@ public static class PlayerExtensions
|
||||
if (pawn.LifeState != (int)LifeState_t.LIFE_ALIVE)
|
||||
return;
|
||||
|
||||
var controller = pawn.Controller.Value?.As<CCSPlayerController>();
|
||||
|
||||
/* Teleport in a random direction - thank you, Mani!*/
|
||||
/* Thank you AM & al!*/
|
||||
var random = new Random();
|
||||
@@ -184,6 +187,17 @@ public static class PlayerExtensions
|
||||
pawn.AbsVelocity.Y = vel.Y;
|
||||
pawn.AbsVelocity.Z = vel.Z;
|
||||
|
||||
if (controller != null && controller.IsValid)
|
||||
{
|
||||
var shakeMessage = UserMessage.FromPartialName("Shake");
|
||||
shakeMessage.SetFloat("duration", 1);
|
||||
shakeMessage.SetFloat("amplitude", 10);
|
||||
shakeMessage.SetFloat("frequency", 1f);
|
||||
shakeMessage.SetInt("command", 0);
|
||||
shakeMessage.Recipients.Add(controller);
|
||||
shakeMessage.Send();
|
||||
}
|
||||
|
||||
if (damage <= 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using CounterStrikeSharp.API.Core.Plugin.Host;
|
||||
using CounterStrikeSharp.API.Modules.Entities.Constants;
|
||||
using CS2_SimpleAdmin.Managers;
|
||||
using MenuManager;
|
||||
@@ -544,6 +545,18 @@ internal static class Helper
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
internal static IPluginManager? GetPluginManager()
|
||||
{
|
||||
// Access the singleton instance of Application
|
||||
var applicationInstance = Application.Instance;
|
||||
|
||||
// Use Reflection to access the private _pluginManager field
|
||||
var pluginManagerField = typeof(Application).GetField("_pluginManager", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var pluginManager = pluginManagerField?.GetValue(applicationInstance) as IPluginManager;
|
||||
|
||||
return pluginManager;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PluginInfo
|
||||
@@ -690,11 +703,30 @@ public static class WeaponHelper
|
||||
|
||||
public static List<(string EnumMemberValue, CsItem EnumValue)> GetWeaponsByPartialName(string input)
|
||||
{
|
||||
// Normalize input for case-insensitive comparison
|
||||
var normalizedInput = input.ToLowerInvariant();
|
||||
|
||||
// Find all matching weapons based on the input
|
||||
var matchingWeapons = WeaponsEnumCache.Value
|
||||
.Where(kvp => kvp.Key.Contains(input))
|
||||
.Select(kvp => (kvp.Key, kvp.Value))
|
||||
.Where(kvp => kvp.Key.Contains(normalizedInput, StringComparison.InvariantCultureIgnoreCase))
|
||||
.Select(kvp => (EnumMemberValue: kvp.Key, EnumValue: kvp.Value))
|
||||
.ToList();
|
||||
|
||||
return matchingWeapons;
|
||||
// Check for an exact match first
|
||||
var exactMatch = matchingWeapons
|
||||
.FirstOrDefault(m => m.EnumMemberValue.Equals(input, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (exactMatch.EnumMemberValue != null)
|
||||
{
|
||||
// Return a list containing only the exact match
|
||||
return [exactMatch];
|
||||
}
|
||||
|
||||
// If no exact match, get all matches that start with the input
|
||||
var filteredWeapons = matchingWeapons
|
||||
.Where(m => m.EnumMemberValue.StartsWith(normalizedInput, StringComparison.InvariantCultureIgnoreCase))
|
||||
.ToList();
|
||||
|
||||
return filteredWeapons; // Return all relevant matches for the partial input
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
using CounterStrikeSharp.API.Modules.Timers;
|
||||
using CounterStrikeSharp.API.ValveConstants.Protobuf;
|
||||
using CS2_SimpleAdminApi;
|
||||
using Dapper;
|
||||
@@ -205,6 +206,20 @@ public class PlayerManager
|
||||
|
||||
public void CheckPlayersTimer()
|
||||
{
|
||||
CS2_SimpleAdmin.Instance.AddTimer(0.1f, () =>
|
||||
{
|
||||
if (CS2_SimpleAdmin.GravityPlayers.Count <= 0) return;
|
||||
|
||||
foreach (var value in CS2_SimpleAdmin.GravityPlayers)
|
||||
{
|
||||
if (value.Key is not
|
||||
{ IsValid: true, Connected: PlayerConnectedState.PlayerConnected, PawnIsAlive: true })
|
||||
continue;
|
||||
|
||||
value.Key.SetGravity(value.Value);
|
||||
}
|
||||
}, TimerFlags.REPEAT);
|
||||
|
||||
CS2_SimpleAdmin.Instance.AddTimer(61.0f, () =>
|
||||
{
|
||||
#if DEBUG
|
||||
@@ -214,23 +229,50 @@ public class PlayerManager
|
||||
return;
|
||||
|
||||
var players = Helper.GetValidPlayers();
|
||||
var onlinePlayers = players
|
||||
.Where(player => player.IpAddress != null)
|
||||
.Select(player => (player.IpAddress, player.SteamID, player.UserId, player.Slot))
|
||||
.ToList();
|
||||
var onlinePlayers = new List<(string? IpAddress, ulong SteamID, int? UserId, int Slot)>();
|
||||
// var onlinePlayers = players
|
||||
// .Where(player => player.IpAddress != null)
|
||||
// .Select(player => (player.IpAddress, player.SteamID, player.UserId, player.Slot))
|
||||
// .ToList();
|
||||
|
||||
Task.Run(async () =>
|
||||
foreach (var player in players)
|
||||
{
|
||||
await CS2_SimpleAdmin.Instance.MuteManager.ExpireOldMutes();
|
||||
await CS2_SimpleAdmin.Instance.BanManager.ExpireOldBans();
|
||||
await CS2_SimpleAdmin.Instance.WarnManager.ExpireOldWarns();
|
||||
await CS2_SimpleAdmin.Instance.PermissionManager.DeleteOldAdmins();
|
||||
|
||||
CS2_SimpleAdmin.BannedPlayers.Clear();
|
||||
|
||||
if (onlinePlayers.Count > 0)
|
||||
if (player.IpAddress != null)
|
||||
onlinePlayers.Add((player.IpAddress, player.SteamID, player.UserId, player.Slot));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var expireTasks = new[]
|
||||
{
|
||||
try
|
||||
CS2_SimpleAdmin.Instance.BanManager.ExpireOldBans(),
|
||||
CS2_SimpleAdmin.Instance.MuteManager.ExpireOldMutes(),
|
||||
CS2_SimpleAdmin.Instance.WarnManager.ExpireOldWarns(),
|
||||
CS2_SimpleAdmin.Instance.PermissionManager.DeleteOldAdmins()
|
||||
};
|
||||
|
||||
Task.WhenAll(expireTasks).ContinueWith(t =>
|
||||
{
|
||||
if (t is not { IsFaulted: true, Exception: not null }) return;
|
||||
|
||||
foreach (var ex in t.Exception.InnerExceptions)
|
||||
{
|
||||
CS2_SimpleAdmin._logger?.LogError($"Error expiring penalties: {ex.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CS2_SimpleAdmin._logger?.LogError($"Unexpected error: {ex.Message}");
|
||||
}
|
||||
|
||||
CS2_SimpleAdmin.BannedPlayers.Clear();
|
||||
|
||||
if (onlinePlayers.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await CS2_SimpleAdmin.Instance.BanManager.CheckOnlinePlayers(onlinePlayers);
|
||||
|
||||
@@ -238,39 +280,54 @@ public class PlayerManager
|
||||
{
|
||||
await CS2_SimpleAdmin.Instance.MuteManager.CheckOnlineModeMutes(onlinePlayers);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
}).ContinueWith(t =>
|
||||
{
|
||||
CS2_SimpleAdmin._logger?.LogError("Unable to check bans for online players");
|
||||
}
|
||||
if (t is not { IsFaulted: true, Exception: not null }) return;
|
||||
|
||||
foreach (var ex in t.Exception.InnerExceptions)
|
||||
{
|
||||
CS2_SimpleAdmin._logger?.LogError($"Error checking online players: {ex.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
await Server.NextFrameAsync(() =>
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (onlinePlayers.Count > 0)
|
||||
CS2_SimpleAdmin._logger?.LogError($"Unexpected error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
if (onlinePlayers.Count <= 0) return;
|
||||
|
||||
{
|
||||
try
|
||||
{
|
||||
var penalizedSlots = players
|
||||
.Where(player => PlayerPenaltyManager.IsSlotInPenalties(player.Slot))
|
||||
.Select(player => new
|
||||
{
|
||||
Player = player,
|
||||
IsMuted = PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute),
|
||||
IsSilenced = PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence),
|
||||
IsGagged = PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag)
|
||||
});
|
||||
|
||||
foreach (var entry in penalizedSlots)
|
||||
{
|
||||
try
|
||||
// If the player is not muted or silenced, set voice flags to normal
|
||||
if (!entry.IsMuted && !entry.IsSilenced)
|
||||
{
|
||||
foreach (var player in players.Where(player => PlayerPenaltyManager.IsSlotInPenalties(player.Slot)))
|
||||
{
|
||||
if (!PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) && !PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
|
||||
player.VoiceFlags = VoiceFlags.Normal;
|
||||
|
||||
if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence) ||
|
||||
PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) ||
|
||||
PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag)) continue;
|
||||
player.VoiceFlags = VoiceFlags.Normal;
|
||||
}
|
||||
|
||||
PlayerPenaltyManager.RemoveExpiredPenalties();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
CS2_SimpleAdmin._logger?.LogError("Unable to remove old penalties");
|
||||
entry.Player.VoiceFlags = VoiceFlags.Normal;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
PlayerPenaltyManager.RemoveExpiredPenalties();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CS2_SimpleAdmin._logger?.LogError($"Unable to remove old penalties: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.REPEAT);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace CS2_SimpleAdmin.Managers;
|
||||
|
||||
public class ServerManager
|
||||
{
|
||||
private int _getIpTryCount = 0;
|
||||
private int _getIpTryCount;
|
||||
|
||||
public void LoadServerData()
|
||||
{
|
||||
|
||||
@@ -26,11 +26,17 @@ public static class ManageServerMenu
|
||||
|
||||
// permissions
|
||||
var hasMap = AdminManager.CommandIsOverriden("css_map") ? AdminManager.PlayerHasPermissions(admin, AdminManager.GetPermissionOverrides("css_map")) : AdminManager.PlayerHasPermissions(admin, "@css/changemap");
|
||||
var hasPlugins = AdminManager.CommandIsOverriden("css_pluginsmanager") ? AdminManager.PlayerHasPermissions(admin, AdminManager.GetPermissionOverrides("css_pluginsmanager")) : AdminManager.PlayerHasPermissions(admin, "@css/root");
|
||||
|
||||
//bool hasMap = AdminManager.PlayerHasPermissions(admin, "@css/changemap");
|
||||
|
||||
// options added in order
|
||||
|
||||
if (hasPlugins)
|
||||
{
|
||||
options.Add(new ChatMenuOptionData(localizer?["sa_menu_pluginsmanager_title"] ?? "Manage Plugins", () => admin.ExecuteClientCommandFromServer("css_pluginsmanager")));
|
||||
}
|
||||
|
||||
if (hasMap)
|
||||
{
|
||||
options.Add(new ChatMenuOptionData(localizer?["sa_changemap"] ?? "Change Map", () => ChangeMapMenu(admin)));
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.6.5a
|
||||
1.6.7a
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "إدارة اللاعبين",
|
||||
"sa_menu_disconnected_title": "اللاعبون الأخيرون",
|
||||
"sa_menu_disconnected_action_title": "اختر الإجراء",
|
||||
"sa_menu_pluginsmanager_title": "إدارة الإضافات",
|
||||
|
||||
"sa_player": "اللاعب",
|
||||
"sa_console": "وحدة التحكم",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}نتائج التصويت لـ {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}الإداري: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(إداري) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(لاعب) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** أصدر الأمر `{1}` على الخادم `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** أصدر الأمر `{1}` على الخادم `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}مفعل {default}الإضافة {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}معطل {default}الإضافة {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Spieler verwalten",
|
||||
"sa_menu_disconnected_title": "Letzte Spieler",
|
||||
"sa_menu_disconnected_action_title": "Aktion auswählen",
|
||||
"sa_menu_pluginsmanager_title": "Plugins verwalten",
|
||||
|
||||
"sa_player": "Spieler",
|
||||
"sa_console": "Konsole",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}ABSTIMMUNGSERGEBNISSE FÜR {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(SPIELER) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** hat den Befehl `{1}` auf dem Server `HOSTNAME` ausgeführt"
|
||||
"sa_discord_log_command": "**{0}** hat den Befehl `{1}` auf dem Server `HOSTNAME` ausgeführt",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Aktiviert {default}Plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Deaktiviert {default}Plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Players Manage",
|
||||
"sa_menu_disconnected_title": "Recent players",
|
||||
"sa_menu_disconnected_action_title": "Select action",
|
||||
"sa_menu_pluginsmanager_title": "Plugins Manage",
|
||||
|
||||
"sa_player": "Player",
|
||||
"sa_console": "Console",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}VOTING RESULTS FOR {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(PLAYER) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** issued command `{1}` on server `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** issued command `{1}` on server `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Enabled {default}plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Disabled {default}plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Administrar Jugadores",
|
||||
"sa_menu_disconnected_title": "Jugadores recientes",
|
||||
"sa_menu_disconnected_action_title": "Seleccionar acción",
|
||||
"sa_menu_pluginsmanager_title": "Gestionar plugins",
|
||||
|
||||
"sa_player": "Jugador",
|
||||
"sa_console": "Consola",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}RESULTADOS DE LA VOTACIÓN PARA {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(JUGADOR) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** ejecutó el comando `{1}` en el servidor `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** ejecutó el comando `{1}` en el servidor `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Habilitado {default}plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Deshabilitado {default}plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "مدیریت بازیکنان",
|
||||
"sa_menu_disconnected_title": "آخرین بازیکنان",
|
||||
"sa_menu_disconnected_action_title": "انتخاب عملیات",
|
||||
"sa_menu_pluginsmanager_title": "مدیریت پلاگینها",
|
||||
|
||||
"sa_player": "بازیکن",
|
||||
"sa_console": "کنسول",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}نتایج رأیگیری برای {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ادمین: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ادمین) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(بازیکن) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** فرمان `{1}` را در سرور `HOSTNAME` اجرا کرد"
|
||||
"sa_discord_log_command": "**{0}** فرمان `{1}` را در سرور `HOSTNAME` اجرا کرد",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}فعال {default}پلاگین {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}غیرفعال {default}پلاگین {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Gérer les joueurs",
|
||||
"sa_menu_disconnected_title": "Derniers joueurs",
|
||||
"sa_menu_disconnected_action_title": "Choisir une action",
|
||||
"sa_menu_pluginsmanager_title": "Gérer les plugins",
|
||||
|
||||
"sa_player": "Joueur",
|
||||
"sa_console": "Console",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}RÉSULTATS DU VOTE POUR {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(JOUEUR) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** a exécuté la commande `{1}` sur le serveur `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** a exécuté la commande `{1}` sur le serveur `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Activé {default}plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Désactivé {default}plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Spēlētāju pārvaldība",
|
||||
"sa_menu_disconnected_title": "Pēdējie spēlētāji",
|
||||
"sa_menu_disconnected_action_title": "Izvēlieties darbību",
|
||||
"sa_menu_pluginsmanager_title": "Pārvaldīt spraudņus",
|
||||
|
||||
"sa_player": "Spēlētājs",
|
||||
"sa_console": "Konsole",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}BALSOŠANAS REZULTĀTI PAR {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(SPĒLĒTĀJS) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** izpildīja komandu `{1}` serverī `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** izpildīja komandu `{1}` serverī `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Ieslēgts {default}spraudnis {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Izslēgts {default}spraudnis {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Zarządzaj graczami",
|
||||
"sa_menu_disconnected_title": "Ostatni gracze",
|
||||
"sa_menu_disconnected_action_title": "Wybierz akcje",
|
||||
"sa_menu_pluginsmanager_title": "Zarządzaj pluginami",
|
||||
|
||||
"sa_player": "Gracz",
|
||||
"sa_console": "Konsola",
|
||||
@@ -122,7 +123,11 @@
|
||||
"sa_admin_vote_message_results": "{lime}WYNIKI GŁOSOWANIA {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}[{1}]",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(GRACZ) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** użył komendy `{1}` na serwerze `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** użył komendy `{1}` na serwerze `HOSTNAME`",
|
||||
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Włączono {default}plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Wyłączono {default}plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Gerenciar Jogadores",
|
||||
"sa_menu_disconnected_title": "Jogadores recentes",
|
||||
"sa_menu_disconnected_action_title": "Selecionar ação",
|
||||
"sa_menu_pluginsmanager_title": "Gerenciar Plugins",
|
||||
|
||||
"sa_player": "Jogador",
|
||||
"sa_console": "Console",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}RESULTADOS DA VOTAÇÃO PARA {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(JOGADOR) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** executou o comando `{1}` no servidor `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** executou o comando `{1}` no servidor `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Ativado {default}plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Desativado {default}plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Gerenciar Jogadores",
|
||||
"sa_menu_disconnected_title": "Jogadores recentes",
|
||||
"sa_menu_disconnected_action_title": "Selecionar ação",
|
||||
"sa_menu_pluginsmanager_title": "Gerir Plugins",
|
||||
|
||||
"sa_player": "Jogador",
|
||||
"sa_console": "Console",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}RESULTADOS DA VOTAÇÃO PARA {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}ADMIN: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(ADMIN) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(JOGADOR) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** executou o comando `{1}` no servidor `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** executou o comando `{1}` no servidor `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Ativado {default}plugin {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Desativado {default}plugin {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Управление игроками",
|
||||
"sa_menu_disconnected_title": "Последние игроки",
|
||||
"sa_menu_disconnected_action_title": "Выберите действие",
|
||||
"sa_menu_pluginsmanager_title": "Управление плагинами",
|
||||
|
||||
"sa_player": "Игрок",
|
||||
"sa_console": "Консоль",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}РЕЗУЛЬТАТЫ ГОЛОСОВАНИЯ ЗА {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}АДМИН: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(ВИП ЧАТ) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(АДМИН) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(ИГРОК) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** выполнил команду `{1}` на сервере `HOSTNAME`"
|
||||
"sa_discord_log_command": "**{0}** выполнил команду `{1}` на сервере `HOSTNAME`",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Включен {default}плагин {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Выключен {default}плагин {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "Oyuncu Yönetimi",
|
||||
"sa_menu_disconnected_title": "Son oyuncular",
|
||||
"sa_menu_disconnected_action_title": "Eylem seçin",
|
||||
"sa_menu_pluginsmanager_title": "Eklentileri Yönet",
|
||||
|
||||
"sa_player": "Oyuncu",
|
||||
"sa_console": "Konsol",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}OY SONUÇLARI {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}Yönetici: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(Yönetici) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(Oyuncu) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** `{1}` komutunu `HOSTNAME` sunucusunda gerçekleştirdi"
|
||||
"sa_discord_log_command": "**{0}** `{1}` komutunu `HOSTNAME` sunucusunda gerçekleştirdi",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}Etkinleştirildi {default}eklenti {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}Devre Dışı Bırakıldı {default}eklenti {lightred}{0}"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"sa_menu_players_manage": "玩家管理",
|
||||
"sa_menu_disconnected_title": "最近的玩家",
|
||||
"sa_menu_disconnected_action_title": "选择操作",
|
||||
"sa_menu_pluginsmanager_title": "管理插件",
|
||||
|
||||
"sa_player": "玩家",
|
||||
"sa_console": "控制台",
|
||||
@@ -122,7 +123,10 @@
|
||||
"sa_admin_vote_message_results": "{lime}投票结果 {gold}{0}",
|
||||
"sa_admin_vote_message_results_answer": "{lime}{0} {default}- {gold}{1}",
|
||||
"sa_adminsay_prefix": "{RED}管理员: {lightred}{0}{default}",
|
||||
"sa_vipchat_template": "{LIME}(VIP CHAT) {0}{default}: {1}",
|
||||
"sa_adminchat_template_admin": "{LIME}(管理员) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_adminchat_template_player": "{SILVER}(玩家) {lightred}{0}{default}: {lightred}{1}{default}",
|
||||
"sa_discord_log_command": "**{0}** 在服务器 `HOSTNAME` 上发出了 `{1}` 命令"
|
||||
"sa_discord_log_command": "**{0}** 在服务器 `HOSTNAME` 上发出了 `{1}` 命令",
|
||||
"sa_menu_pluginsmanager_loaded": "{lime}已启用 {default}插件 {lime}{0}",
|
||||
"sa_menu_pluginsmanager_unloaded": "{lightred}已禁用 {default}插件 {lightred}{0}"
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.276" />
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.284" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PlayerInfo(
|
||||
public DiePosition? DiePosition { get; set; }
|
||||
}
|
||||
|
||||
public class DiePosition(Vector? position = null, QAngle? angle = null)
|
||||
public struct 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