fixed reloadadmins

This commit is contained in:
Dawid Bepierszcz
2024-04-02 19:55:48 +02:00
parent 89d27e1bd3
commit 3abf246f9b
2 changed files with 4 additions and 20 deletions

View File

@@ -213,12 +213,12 @@ namespace CS2_SimpleAdmin
{ {
if (_database == null) return; if (_database == null) return;
ReloadAdmins(); ReloadAdmins(caller);
command.ReplyToCommand("Reloaded sql admins"); command.ReplyToCommand("Reloaded sql admins");
} }
public void ReloadAdmins() public void ReloadAdmins(CCSPlayerController? caller)
{ {
if (_database == null) return; if (_database == null) return;
@@ -473,13 +473,6 @@ namespace CS2_SimpleAdmin
_command = $"ds_workshop_changelevel {map.Replace("ws:", "")}"; _command = $"ds_workshop_changelevel {map.Replace("ws:", "")}";
} }
//if (_discordWebhookClientLog != null && _localizer != null)
//{
// string communityUrl = caller != null ? "<" + new SteamID(caller.SteamID).ToCommunityUrl().ToString() + ">" : "<https://steamcommunity.com/profiles/0>";
// string commandName = command?.GetCommandString ?? "css_changemap";
// _discordWebhookClientLog.SendMessageAsync(Helper.GenerateMessageDiscord(_localizer["sa_discord_log_command", $"[{callerName}]({communityUrl})", commandName]));
//}
AddTimer(3.0f, () => AddTimer(3.0f, () =>
{ {
Server.ExecuteCommand(_command); Server.ExecuteCommand(_command);
@@ -565,15 +558,6 @@ namespace CS2_SimpleAdmin
} }
} }
//if (_discordWebhookClientLog != null && _localizer != null)
//{
// string communityUrl = caller != null ? "<" + new SteamID(caller.SteamID).ToCommunityUrl().ToString() + ">" : "<https://steamcommunity.com/profiles/0>";
// string commandName = command?.GetCommandString ?? "css_changewsmap";
// _discordWebhookClientLog.SendMessageAsync(Helper.GenerateMessageDiscord(_localizer["sa_discord_log_command", $"[{callerName}]({communityUrl})", commandName]));
//}
//if (command is not null)
// Helper.LogCommand(caller, command);
AddTimer(3.0f, () => AddTimer(3.0f, () =>
{ {
Server.ExecuteCommand(_command); Server.ExecuteCommand(_command);

View File

@@ -77,9 +77,9 @@ namespace CS2_SimpleAdmin.Menus
CS2_SimpleAdmin.Instance.RemoveAdmin(admin, player.SteamID.ToString()); CS2_SimpleAdmin.Instance.RemoveAdmin(admin, player.SteamID.ToString());
} }
private static void ReloadAdmins() private static void ReloadAdmins(CCSPlayerController admin)
{ {
CS2_SimpleAdmin.Instance.ReloadAdmins(); CS2_SimpleAdmin.Instance.ReloadAdmins(admin);
} }
} }
} }