[Home] - [Project Page]

Overview

Code

 #include <main.h>
 #include <Modules.h>
 class CExampleMod : public CModule {
 public:
     MODCONSTRUCTOR(CExampleMod) {}
     virtual ~CExampleMod() {}
     virtual void OnModCommand(const string& sCommand) {
         if (strcasecmp(sCommand.c_str(), "HELP") == 0) {
             PutModule("I'd like to help, but I am just an example");
         } else {
             PutModule("Unknown command, try HELP");
         }
     }
 };
 MODULEDEFS(CExampleMod)

Output

 <zncuser> test
 <*example> Unknown command, try HELP
 <zncuser> help
 <*example> I'd like to help, but I am just an example