mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Commands] Cleanup #hideme Command (#3043)
# Notes - Cleanup messages and logic.
This commit is contained in:
parent
457e800c73
commit
22d7ef6763
@ -182,7 +182,7 @@ int command_init(void)
|
||||
command_add("heal", "Completely heal your target", AccountStatus::Steward, command_heal) ||
|
||||
command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) ||
|
||||
command_add("heromodel", "[Hero Model] [Slot] - Set your or your target's appearance to a full set of Hero's Forge Armor, if slot is set, sends exact model just to slot.", AccountStatus::GMMgmt, command_heromodel) ||
|
||||
command_add("hideme", "[on/off] - Hide yourself from spawn lists.", AccountStatus::QuestTroupe, command_hideme) ||
|
||||
command_add("hideme", "[On|Off] or [0|1] - Hide yourself from players below your status level.", AccountStatus::QuestTroupe, command_hideme) ||
|
||||
command_add("hotfix", "[hotfix_name] - Reloads shared memory into a hotfix, equiv to load_shared_memory followed by apply_shared_memory", AccountStatus::GMImpossible, command_hotfix) ||
|
||||
command_add("hp", "Refresh your HP bar from the server.", AccountStatus::Player, command_hp) ||
|
||||
command_add("incstat", "Increases or Decreases a client's stats permanently.", AccountStatus::GMMgmt, command_incstat) ||
|
||||
|
||||
@ -1,16 +1,31 @@
|
||||
#include "../client.h"
|
||||
#include "../string_ids.h"
|
||||
|
||||
void command_hideme(Client *c, const Seperator *sep)
|
||||
{
|
||||
bool state = atobool(sep->arg[1]);
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #hideme [On|Off]");
|
||||
c->Message(Chat::White, "Usage: #hideme [0|1]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #hideme [on/off]");
|
||||
}
|
||||
else {
|
||||
c->SetHideMe(state);
|
||||
c->MessageString(Chat::Broadcasts, c->GetHideMe() ? NOW_INVISIBLE : NOW_VISIBLE, c->GetName());
|
||||
auto t = c;
|
||||
if (c->GetGM() && c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const auto is_hidden = Strings::ToBool(sep->arg[1]);
|
||||
|
||||
t->SetHideMe(is_hidden);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} now {} to players below a status level of {}.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "are" : "is",
|
||||
is_hidden ? "invisible" : "visible",
|
||||
t->Admin()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user