Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. class commandscript_example : public CommandScript
  2. {
  3.     public:
  4.         commandscript_example() : CommandScript("commandscript_example") { }
  5.  
  6.         ChatCommand* GetCommands()
  7.         {
  8.             static ChatCommand HelloWorldCommandTable[] =
  9.             {
  10.                 { "hello",          SEC_PLAYER,         false,  &ChatHandler::HandleHelloWorldCommand,         "", NULL },
  11.                 { NULL,             0,                  false, NULL,                                           "", NULL }
  12.             };
  13.             return HelloWorldCommandTable;
  14.         }
  15.         bool ChatHandler::HandleHelloWorldCommand(const char* /*args*/)
  16.         {
  17.             PSendSysMessage("Hello World");
  18.             return true;
  19.         }
  20.  
  21. void AddSC_commandscript_scripts()
  22. {
  23.     new commandscript_example();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement