diff --git a/zone/client.cpp b/zone/client.cpp index ed29755ab..fe163a2c7 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2076,7 +2076,13 @@ bool Client::ChangeFirstName(const char* in_firstname, const char* gmname) void Client::SetGM(bool toggle) { m_pp.gm = toggle ? 1 : 0; m_inv.SetGMInventory((bool)m_pp.gm); - Message(Chat::Red, "You are %s a GM.", m_pp.gm ? "now" : "no longer"); + Message( + Chat::White, + fmt::format( + "You are {} flagged as a GM.", + m_pp.gm ? "now" : "no longer" + ).c_str() + ); SendAppearancePacket(AT_GM, m_pp.gm); Save(); UpdateWho(); diff --git a/zone/command.cpp b/zone/command.cpp index 0e89dc4a9..619406a69 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -195,7 +195,7 @@ int command_init(void) command_add("giveitem", "[itemid] [charges] - Summon an item onto your target's cursor. Charges are optional.", AccountStatus::GMMgmt, command_giveitem) || command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) || command_add("globalview", "Lists all qglobals in cache if you were to do a quest with this target.", AccountStatus::QuestTroupe, command_globalview) || - command_add("gm", "- Turn player target's or your GM flag on or off", AccountStatus::QuestTroupe, command_gm) || + command_add("gm", "[On|Off] - Modify your or your target's GM Flag", AccountStatus::QuestTroupe, command_gm) || command_add("gmspeed", "[on/off] - Turn GM speed hack on/off for you or your player target", AccountStatus::GMAdmin, command_gmspeed) || command_add("gmzone", "[zone_short_name] [zone_version=0] [identifier=gmzone] - Zones to a private GM instance", AccountStatus::GMAdmin, command_gmzone) || command_add("goto", "[playername] or [x y z] [h] - Teleport to the provided coordinates or to your target", AccountStatus::Steward, command_goto) || diff --git a/zone/gm_commands/gm.cpp b/zone/gm_commands/gm.cpp index 2920c5026..d781bb93a 100755 --- a/zone/gm_commands/gm.cpp +++ b/zone/gm_commands/gm.cpp @@ -2,26 +2,28 @@ void command_gm(Client *c, const Seperator *sep) { - bool state = atobool(sep->arg[1]); - Client *t = c; + int arguments = sep->argnum; + if (!arguments) { + c->Message(Chat::White, "Usage: #gm [On|Off]"); + return; + } + bool gm_flag = atobool(sep->arg[1]); + Client *target = c; if (c->GetTarget() && c->GetTarget()->IsClient()) { - t = c->GetTarget()->CastToClient(); + target = c->GetTarget()->CastToClient(); } - if (sep->arg[1][0] != 0) { - t->SetGM(state); - c->Message(Chat::White, "%s is %s a GM.", t->GetName(), state ? "now" : "no longer"); - } - else { - c->Message(Chat::White, "Usage: #gm [on/off]"); + target->SetGM(gm_flag); + if (c != target) { + c->Message( + Chat::White, + fmt::format( + "{} ({}) is {} flagged as a GM.", + target->GetCleanName(), + target->GetID(), + gm_flag ? "now" : "no longer" + ).c_str() + ); } } - -// there's no need for this, as /summon already takes care of it -// this command is here for reference but it is not added to the -// list above - -//To whoever wrote the above: And what about /kill, /zone, /zoneserver, etc? -//There is a reason for the # commands: so that admins can specifically enable certain -//commands for their users. Some might want users to #summon but not to /kill. Cant do that if they are a GM