Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This script is made by Rochet2
- Please give credits if you are going to use this script somewhere.
- For TrinityCore
- Trinirycore command example as the base and a little help from SD2 forums.
- Adds a .developer command to your core.
- The notifications work like the GM tag's,
- but the command ONLY shows the <Dev> tag before your name, does nothing more
- */
- #include "ScriptPCH.h"
- #include "Chat.h"
- class devtag_commandscript : public CommandScript
- {
- public:
- devtag_commandscript() : CommandScript("devtag_commandscript") { }
- static bool DevTagWorldCommand(ChatHandler* handler, const char* args)
- {
- if (!*args)
- {
- if (handler->GetSession()->GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER))
- handler->GetSession()->SendAreaTriggerMessage("|cffff0000Dev mode is ON|r");
- else
- handler->GetSession()->SendAreaTriggerMessage("|cffff0000Dev mode is OFF|r");
- return true;
- }
- std::string argstr = (char*)args;
- if (argstr == "on")
- {
- handler->GetSession()->SendAreaTriggerMessage("|cffff0000Dev mode is ON|r");
- handler->GetSession()->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
- return true;
- }
- if (argstr == "off")
- {
- handler->GetSession()->SendAreaTriggerMessage("|cffff0000Dev mode is OFF|r");
- handler->GetSession()->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
- return true;
- }
- handler->SendSysMessage(LANG_USE_BOL);
- handler->SetSentErrorMessage(true);
- return false;
- }
- ChatCommand* GetCommands() const
- {
- static ChatCommand DevTagCommandTable[] =
- {
- { "developer", SEC_PLAYER, false, &DevTagWorldCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- return DevTagCommandTable;
- }
- };
- void AddSC_devtag_commandscript()
- {
- new devtag_commandscript();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement