Jump to content

GM commands


Guest Gr@BiT
 Share

Recommended Posts

Hello all.

At my server I need give GMs some administrators chat commands. For example:

.gm fly
.npc info
.additem
.ban
.unban

At first I modify Chat.cpp: (it's just a part of the patch)

***************
*** 82,106 ****

     static ChatCommand banCommandTable[] =
     {
!         { "account",        SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanAccountCommand,          "", NULL },
!         { "character",      SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanCharacterCommand,        "", NULL },
!         { "ip",             SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanIPCommand,               "", NULL },
         { NULL,             0,                  false, NULL,                                           "", NULL }
     };

     static ChatCommand baninfoCommandTable[] =
     {
!         { "account",        SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanInfoAccountCommand,      "", NULL },
!         { "character",      SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanInfoCharacterCommand,    "", NULL },
!         { "ip",             SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanInfoIPCommand,           "", NULL },
         { NULL,             0,                  false, NULL,                                           "", NULL }
     };

     static ChatCommand banlistCommandTable[] =
     {
!         { "account",        SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanListAccountCommand,      "", NULL },
!         { "character",      SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanListCharacterCommand,    "", NULL },
!         { "ip",             SEC_ADMINISTRATOR,  true,  &ChatHandler::HandleBanListIPCommand,           "", NULL },
         { NULL,             0,                  false, NULL,                                           "", NULL }
     };

--- 82,106 ----

     static ChatCommand banCommandTable[] =
     {
!         { "account",        SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanAccountCommand,          "", NULL },
!         { "character",      SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanCharacterCommand,        "", NULL },
!         { "ip",             SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanIPCommand,               "", NULL },
         { NULL,             0,                  false, NULL,                                           "", NULL }
     };

     static ChatCommand baninfoCommandTable[] =
     {
!         { "account",        SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanInfoAccountCommand,      "", NULL },
!         { "character",      SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanInfoCharacterCommand,    "", NULL },
!         { "ip",             SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanInfoIPCommand,           "", NULL },
         { NULL,             0,                  false, NULL,                                           "", NULL }
     };

     static ChatCommand banlistCommandTable[] =
     {
!         { "account",        SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanListAccountCommand,      "", NULL },
!         { "character",      SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanListCharacterCommand,    "", NULL },
!         { "ip",             SEC_GAMEMASTER,     true,  &ChatHandler::HandleBanListIPCommand,           "", NULL },
         { NULL,             0,                  false, NULL,                                           "", NULL }
     };

And recompile MaNGOS but this commands don't work.

Next I try to move some functions like ChatHandler::HandleBanAccountCommand, ChatHandler::HandleBanCharacterCommand and ChatHandler::HandleBanIPCommand from Level3.cpp to Level2.cpp and recompile. But my GMs still have not this commands. :( What I do wrong?

P.S. Sorry for my bad English.

Link to comment
Share on other sites

Am working on a additem that removes also. Like this

.additem -1234 removes item 1234 from backpack of player.

.additem -1234 4 removes 4 of the 1234 items from the backpack of player.

.additem -1234 4 bank removes the same but from the bank of player.

I could do that or make a new delitem command. Or maybe just item command.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use