mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-03-08 23:59:06 +00:00
Merge done?
This commit is contained in:
@@ -357,15 +357,15 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
{
|
{
|
||||||
if (caller!.CanTarget(player))
|
if (caller!.CanTarget(player))
|
||||||
{
|
{
|
||||||
Who(caller, player, banManager, muteManager);
|
Who(caller, player, _banManager, _muteManager);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Who(CCSPlayerController? caller, CCSPlayerController player, BanManager banManager = null, MuteManager muteManager = null)
|
internal void Who(CCSPlayerController? caller, CCSPlayerController player, BanManager banManager = null, MuteManager muteManager = null)
|
||||||
{
|
{
|
||||||
banManager ??= new(dbConnectionString, Config);
|
banManager ??= new(_database, Config);
|
||||||
muteManager ??= new(dbConnectionString);
|
muteManager ??= new(_database);
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
@@ -478,30 +478,28 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
player.CommitSuicide(true, true);
|
player.CommitSuicide(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(reason) == false)
|
if (string.IsNullOrEmpty(reason) == false)
|
||||||
{
|
{
|
||||||
player.PrintToCenter(_localizer!["sa_player_kick_message", reason, caller == null ? "Console" : caller.PlayerName]);
|
player.PrintToCenter(_localizer!["sa_player_kick_message", reason, caller == null ? "Console" : caller.PlayerName]);
|
||||||
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!, reason), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!, reason), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
{
|
{
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
sb.Append(_localizer["sa_admin_kick_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
sb.Append(_localizer["sa_admin_kick_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
||||||
Server.PrintToChatAll(sb.ToString());
|
Server.PrintToChatAll(sb.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
{
|
{
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_kick_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
LocalizedString localizedMessage = _localizer["sa_admin_kick_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_gag")]
|
[ConsoleCommand("css_gag")]
|
||||||
@@ -542,89 +540,85 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
internal void Gag(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, MuteManager muteManager = null)
|
internal void Gag(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, MuteManager muteManager = null)
|
||||||
{
|
{
|
||||||
reason ??= "Unknown";
|
reason ??= "Unknown";
|
||||||
muteManager ??= new(dbConnectionString);
|
muteManager ??= new(_database);
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(),
|
SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(),
|
||||||
Name = player?.PlayerName,
|
Name = player?.PlayerName,
|
||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
IpAddress = player?.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
PlayerInfo adminInfo = new PlayerInfo
|
PlayerInfo adminInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(),
|
SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(),
|
||||||
Name = caller?.PlayerName,
|
Name = caller?.PlayerName,
|
||||||
IpAddress = caller?.IpAddress?.Split(":")[0]
|
IpAddress = caller?.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () => { await muteManager.MutePlayer(playerInfo, adminInfo, reason, time); });
|
||||||
{
|
|
||||||
await muteManager.MutePlayer(playerInfo, adminInfo, reason, time);
|
if (TagsDetected)
|
||||||
});
|
NativeAPI.IssueServerCommand($"css_tag_mute {player!.SteamID.ToString()}");
|
||||||
|
|
||||||
|
if (player != null && player.SteamID.ToString() != "" && !gaggedPlayers.Contains(player.SteamID.ToString()))
|
||||||
|
gaggedPlayers.Add(player.SteamID.ToString());
|
||||||
|
|
||||||
|
if (time > 0 && time <= 30)
|
||||||
|
{
|
||||||
|
AddTimer(time * 60, () =>
|
||||||
|
{
|
||||||
|
if (player == null || !player.IsValid || player.AuthorizedSteamID == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (TagsDetected)
|
if (TagsDetected)
|
||||||
NativeAPI.IssueServerCommand($"css_tag_mute {player!.SteamID.ToString()}");
|
NativeAPI.IssueServerCommand($"css_tag_unmute {player!.SteamID.ToString()}");
|
||||||
|
|
||||||
if (player != null && player.SteamID.ToString() != "" && !gaggedPlayers.Contains(player.SteamID.ToString()))
|
if (player != null && player.SteamID.ToString() != "" && gaggedPlayers.Contains(player.SteamID.ToString()))
|
||||||
gaggedPlayers.Add(player.SteamID.ToString());
|
|
||||||
|
|
||||||
if (time > 0 && time <= 30)
|
|
||||||
{
|
{
|
||||||
AddTimer(time * 60, () =>
|
if (gaggedPlayers.TryTake(out string? removedItem) && removedItem != player.SteamID.ToString())
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return;
|
gaggedPlayers.Add(removedItem);
|
||||||
|
|
||||||
if (TagsDetected)
|
|
||||||
NativeAPI.IssueServerCommand($"css_tag_unmute {player!.SteamID.ToString()}");
|
|
||||||
|
|
||||||
if (player != null && player.SteamID.ToString() != "" && gaggedPlayers.Contains(player.SteamID.ToString()))
|
|
||||||
{
|
|
||||||
if (gaggedPlayers.TryTake(out string? removedItem) && removedItem != player.SteamID.ToString())
|
|
||||||
{
|
|
||||||
gaggedPlayers.Add(removedItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//MuteManager _muteManager = new(_database);
|
|
||||||
//_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 0);
|
|
||||||
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (time == 0)
|
|
||||||
{
|
|
||||||
player!.PrintToCenter(_localizer!["sa_player_gag_message_perm", reason, caller == null ? "Console" : caller.PlayerName]);
|
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
|
||||||
{
|
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
|
||||||
sb.Append(_localizer["sa_admin_gag_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
|
||||||
Server.PrintToChatAll(sb.ToString());
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_gag_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
player!.PrintToCenter(_localizer!["sa_player_gag_message_time", reason, time, caller == null ? "Console" : caller.PlayerName]);
|
|
||||||
|
|
||||||
if (caller == null || caller != null && caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
//MuteManager _muteManager = new(_database);
|
||||||
{
|
//_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 0);
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
sb.Append(_localizer["sa_admin_gag_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time]);
|
}
|
||||||
Server.PrintToChatAll(sb.ToString());
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
if (time == 0)
|
||||||
{
|
{
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_gag_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time];
|
player!.PrintToCenter(_localizer!["sa_player_gag_message_perm", reason, caller == null ? "Console" : caller.PlayerName]);
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
}
|
{
|
||||||
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
sb.Append(_localizer["sa_admin_gag_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
||||||
|
Server.PrintToChatAll(sb.ToString());
|
||||||
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
|
{
|
||||||
|
LocalizedString localizedMessage = _localizer["sa_admin_gag_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
||||||
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player!.PrintToCenter(_localizer!["sa_player_gag_message_time", reason, time, caller == null ? "Console" : caller.PlayerName]);
|
||||||
|
|
||||||
|
if (caller == null || caller != null && caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
|
{
|
||||||
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
sb.Append(_localizer["sa_admin_gag_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time]);
|
||||||
|
Server.PrintToChatAll(sb.ToString());
|
||||||
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
|
{
|
||||||
|
LocalizedString localizedMessage = _localizer["sa_admin_gag_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time];
|
||||||
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_addgag")]
|
[ConsoleCommand("css_addgag")]
|
||||||
@@ -885,7 +879,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
internal void Mute(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, MuteManager muteManager = null)
|
internal void Mute(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, MuteManager muteManager = null)
|
||||||
{
|
{
|
||||||
reason ??= "Unknown";
|
reason ??= "Unknown";
|
||||||
muteManager ??= new(dbConnectionString);
|
muteManager ??= new(_database);
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
@@ -918,8 +912,8 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
if (player == null || !player.IsValid || player.AuthorizedSteamID == null)
|
if (player == null || !player.IsValid || player.AuthorizedSteamID == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//MuteManager _muteManager = new(_database);
|
//MuteManager _muteManager = new(_database);
|
||||||
//_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 1);
|
//_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (mutedPlayers.Contains((int)player.Index))
|
if (mutedPlayers.Contains((int)player.Index))
|
||||||
@@ -939,36 +933,34 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
{
|
{
|
||||||
player!.PrintToCenter(_localizer!["sa_player_mute_message_perm", reason, caller == null ? "Console" : caller.PlayerName]);
|
player!.PrintToCenter(_localizer!["sa_player_mute_message_perm", reason, caller == null ? "Console" : caller.PlayerName]);
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
{
|
{
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
sb.Append(_localizer["sa_admin_mute_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
sb.Append(_localizer["sa_admin_mute_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
||||||
Server.PrintToChatAll(sb.ToString());
|
Server.PrintToChatAll(sb.ToString());
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_mute_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player!.PrintToCenter(_localizer!["sa_player_mute_message_time", reason, time, caller == null ? "Console" : caller.PlayerName]);
|
LocalizedString localizedMessage = _localizer["sa_admin_mute_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
||||||
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
|
||||||
{
|
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
|
||||||
sb.Append(_localizer["sa_admin_mute_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time]);
|
|
||||||
Server.PrintToChatAll(sb.ToString());
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_mute_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player!.PrintToCenter(_localizer!["sa_player_mute_message_time", reason, time, caller == null ? "Console" : caller.PlayerName]);
|
||||||
|
|
||||||
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
|
{
|
||||||
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
sb.Append(_localizer["sa_admin_mute_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time]);
|
||||||
|
Server.PrintToChatAll(sb.ToString());
|
||||||
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
|
{
|
||||||
|
LocalizedString localizedMessage = _localizer["sa_admin_mute_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time];
|
||||||
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_addmute")]
|
[ConsoleCommand("css_addmute")]
|
||||||
@@ -1232,7 +1224,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
internal void Ban(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, BanManager banManager = null)
|
internal void Ban(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, BanManager banManager = null)
|
||||||
{
|
{
|
||||||
reason ??= "Unknown";
|
reason ??= "Unknown";
|
||||||
banManager ??= new(dbConnectionString, Config);
|
banManager ??= new(_database, Config);
|
||||||
|
|
||||||
if (player.PawnIsAlive)
|
if (player.PawnIsAlive)
|
||||||
{
|
{
|
||||||
@@ -1254,47 +1246,42 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
IpAddress = caller?.IpAddress?.Split(":")[0]
|
IpAddress = caller?.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () => { await banManager.BanPlayer(playerInfo, adminInfo, reason, time); });
|
||||||
{
|
|
||||||
await banManager.BanPlayer(playerInfo, adminInfo, reason, time);
|
|
||||||
});
|
|
||||||
|
|
||||||
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player!.UserId!), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player!.UserId!), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
|
|
||||||
if (time == 0)
|
if (time == 0)
|
||||||
{
|
{
|
||||||
player!.PrintToCenter(_localizer!["sa_player_ban_message_perm", reason, caller == null ? "Console" : caller.PlayerName]);
|
player!.PrintToCenter(_localizer!["sa_player_ban_message_perm", reason, caller == null ? "Console" : caller.PlayerName]);
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
{
|
{
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
sb.Append(_localizer["sa_admin_ban_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
sb.Append(_localizer["sa_admin_ban_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason]);
|
||||||
Server.PrintToChatAll(sb.ToString());
|
Server.PrintToChatAll(sb.ToString());
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_ban_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
player!.PrintToCenter(_localizer!["sa_player_ban_message_time", reason, time, caller == null ? "Console" : caller.PlayerName]);
|
LocalizedString localizedMessage = _localizer["sa_admin_ban_message_perm", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason];
|
||||||
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
|
||||||
{
|
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
|
||||||
sb.Append(_localizer["sa_admin_ban_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time]);
|
|
||||||
Server.PrintToChatAll(sb.ToString());
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_ban_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player!.PrintToCenter(_localizer!["sa_player_ban_message_time", reason, time, caller == null ? "Console" : caller.PlayerName]);
|
||||||
|
|
||||||
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
|
{
|
||||||
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
sb.Append(_localizer["sa_admin_ban_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time]);
|
||||||
|
Server.PrintToChatAll(sb.ToString());
|
||||||
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
|
{
|
||||||
|
LocalizedString localizedMessage = _localizer["sa_admin_ban_message_time", caller == null ? "Console" : caller.PlayerName, player.PlayerName, reason, time];
|
||||||
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_addban")]
|
[ConsoleCommand("css_addban")]
|
||||||
@@ -1531,18 +1518,17 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
{
|
{
|
||||||
player.CommitSuicide(false, true);
|
player.CommitSuicide(false, true);
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
|
{
|
||||||
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
sb.Append(_localizer["sa_admin_slay_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName]);
|
||||||
|
Server.PrintToChatAll(sb.ToString());
|
||||||
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
LocalizedString localizedMessage = _localizer["sa_admin_slay_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName];
|
||||||
sb.Append(_localizer["sa_admin_slay_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName]);
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
Server.PrintToChatAll(sb.ToString());
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_slay_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_give")]
|
[ConsoleCommand("css_give")]
|
||||||
@@ -1768,18 +1754,16 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
player.Pawn.Value!.Slap(damage);
|
player.Pawn.Value!.Slap(damage);
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
{
|
{
|
||||||
sb.Append(_localizer["sa_admin_slap_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName]);
|
sb.Append(_localizer["sa_admin_slap_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName]);
|
||||||
Server.PrintToChatAll(sb.ToString());
|
Server.PrintToChatAll(sb.ToString());
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
{
|
{
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_slap_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName];
|
LocalizedString localizedMessage = _localizer["sa_admin_slap_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName];
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_team")]
|
[ConsoleCommand("css_team")]
|
||||||
@@ -1854,18 +1838,17 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||||
|
{
|
||||||
|
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||||
|
sb.Append(_localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, teamName]);
|
||||||
|
Server.PrintToChatAll(sb.ToString());
|
||||||
|
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
LocalizedString localizedMessage = _localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, teamName];
|
||||||
sb.Append(_localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, _teamName]);
|
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||||
Server.PrintToChatAll(sb.ToString());
|
|
||||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
|
||||||
{
|
|
||||||
LocalizedString localizedMessage = _localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, _teamName];
|
|
||||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_vote")]
|
[ConsoleCommand("css_vote")]
|
||||||
|
|||||||
Reference in New Issue
Block a user