mirror of
https://github.com/diamante0018/BlackOpsPlugin.git
synced 2025-04-22 02:55:43 +00:00
feature(chat): make module iw4m compatible
This commit is contained in:
parent
93fd2aa115
commit
452f05b507
@ -90,10 +90,12 @@ private:
|
|||||||
game::G_Say(gentity, nullptr, 0, message.data());
|
game::G_Say(gentity, nullptr, 0, message.data());
|
||||||
});
|
});
|
||||||
|
|
||||||
command::add("mutePlayer", [](const command::params_sv& params) {
|
command::add("muteClient", [](const command::params_sv& params) {
|
||||||
if (params.size() < 2) {
|
if (params.size() < 2) {
|
||||||
game::Com_Printf(game::CON_CHANNEL_DONT_FILTER,
|
game::Com_Printf(game::CON_CHANNEL_DONT_FILTER,
|
||||||
"Usage: mutePlayer <client number>\n");
|
"Usage: %s <client number> : prevent the player from "
|
||||||
|
"using the chat\n",
|
||||||
|
params.get(0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,17 +112,21 @@ private:
|
|||||||
mute_player(client);
|
mute_player(client);
|
||||||
});
|
});
|
||||||
|
|
||||||
command::add("unmutePlayer", [](const command::params_sv& params) {
|
command::add("unmute", [](const command::params_sv& params) {
|
||||||
if (params.size() < 2) {
|
if (params.size() < 2) {
|
||||||
game::Com_Printf(game::CON_CHANNEL_DONT_FILTER,
|
game::Com_Printf(game::CON_CHANNEL_DONT_FILTER,
|
||||||
"Usage: unmutePlayer <client number>\n");
|
"Usage: %s <client number>\n", params.get(0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto* client = game::SV_GetPlayerByNum();
|
const auto* client = game::SV_GetPlayerByNum();
|
||||||
|
|
||||||
if (client == nullptr)
|
if (client == nullptr) {
|
||||||
|
if (std::strcmp(params.get(1), "all") == 0) {
|
||||||
|
mute_list.access([&](client_list& clients) { clients.clear(); });
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assert(client->gentity != nullptr);
|
assert(client->gentity != nullptr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user