• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

TrinityCore 3.3.5 Chat Command and Control

slp13at420

Mad Scientist
so I can add `.` commands to all players:
Code:
[COLOR="#808080"]
class Player_Commands : public CommandScript
{
public:
	Player_Commands() : CommandScript("Player_Commands") { }

	std::vector<ChatCommand> GetCommands() const
	{
		static std::vector<ChatCommand> PlayerCommandTable =
		{
			{ "race", rbac::RBAC_IN_GRANTED_LIST, true, &HandleChangeRaceCommand, "allows the player to change there race during next login." },
                };
		static std::vector<ChatCommand> commandTable =
		{
			{ "example", rbac::RBAC_IN_GRANTED_LIST, true, NULL, "custom command tree.", PlayerCommandTable },
		};
		return commandTable;
	}

	static bool HandleChangeRaceCommand(ChatHandler* handler, const char* args)
	{
// do set race change flag for relog
		return true;
	}
};
[/COLOR]

using `rbac::RBAC_IN_GRANTED_LIST` it goes to all players.

But what if I only want the command I added to be visible and usable by admin or gm and higher?

can it be done without editing the auth.rbac tables ?
I have been looking thru the rbac:: menu and I see stuff like for guild commands and other groups but nothing that seems to point to just Admin/192 or any security rank.
 
Top