Allow to unmute using guid

This commit is contained in:
Diavolo 2022-01-01 22:21:25 +01:00
parent 57d598617c
commit 7add84442f
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5

View File

@ -264,22 +264,27 @@ namespace Components
const auto* cmd = params->get(0);
if (params->length() < 2)
{
Logger::Print("Usage: %s <client number>\n%s all = unmute everyone\n", cmd, cmd);
Logger::Print("Usage: %s <client number or guid>\n%s all = unmute everyone\n", cmd, cmd);
return;
}
const auto* client = Game::SV_GetPlayerByNum();
if (client == nullptr)
if (client != nullptr)
{
if (params->get(1) == "all"s)
{
Logger::Print("All players were unmuted\n");
Chat::MuteList.clear();
}
Chat::UnmuteClient(client);
return;
}
if (params->get(1) == "all"s)
{
Logger::Print("All players were unmuted\n");
Chat::MuteList.clear();
}
else
{
Chat::UnmuteClient(client);
const auto SteamID = std::strtoull(params->get(1), nullptr, 16);
Chat::MuteList.erase(SteamID);
}
});
}