File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 11#include " Player.h"
22#include " ScriptMgr.h"
33#include " Chat.h"
4+ #include " ChatCommand.h"
45#include " Config.h"
56
7+ class GmCommands : public AllCommandScript
8+ {
9+ public:
10+ GmCommands () : AllCommandScript(" GmCommands" ) {}
11+
12+ bool OnBeforeIsInvokerVisible (std::string name, Acore::Impl::ChatCommands::CommandPermissions permissions, ChatHandler const & who) override
13+ {
14+ if (who.IsConsole ())
15+ return true ;
16+
17+ Player* player = who.GetPlayer ();
18+
19+ if (!player)
20+ return true ;
21+
22+ uint32 accountID = player->GetSession ()->GetAccountId ();
23+
24+ if (!std::count (eligibleAccounts.begin (), eligibleAccounts.end (), accountID))
25+ return true ; // Account is not eligible
26+
27+ if (std::count (eligibleCommands.begin (), eligibleCommands.end (), name))
28+ return false ; // Command is eligible
29+
30+ return true ; // Command is not eligible
31+ }
32+
33+ private:
34+ std::vector<uint32> eligibleAccounts =
35+ {
36+ 94143 , // HEYITSGMCH
37+ };
38+
39+ std::vector<std::string> eligibleCommands =
40+ {
41+ " gm fly" ,
42+ };
43+ };
44+
645void AddGmCommandScripts ()
746{
47+ new GmCommands ();
848}
You can’t perform that action at this time.
0 commit comments