#include "module.h" #define AUTHOR "SGR" #define VERSION "1.01" /* ----------------------------------------------------------- * Name : bs_assignoperonly * Author: SGR * Date : 08/02/2004 * ----------------------------------------------------------- * Functions: m_bs_assignoperonly * Limitations: None Known * Tested: Ultimate(2.8.x), Unreal(3.2), Viagra, Ultimate(3.x) * ----------------------------------------------------------- * This version has been tested on Ultimate, Viagra and * Unreal. * * This module will restrict the ASSIGN command in BotServ to * Services Opers Only. * * This module has no configurable options. * * Version Changes: * * 1: Works. * 2: Fixed notices big reported by Oren. * ----------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ /* START OF CONFIGURATION BLOCK - please read the comments :) */ /* ---------------------------------------------------------------------- */ /* messages defined below will be sent to users when they phrobited from * using the ASSIGN command for not being a Services Oper. * to use more more than two, remove the // from the beginning of a line * and add the phrase you wish between the "quotes". */ #define ASSIGN_IS_OPER_ONLY1 "Please ask a Services Operator to assign a BotServ bot to your channel" #define ASSIGN_IS_OPER_ONLY2 "You can contact a Services Oper in the help room, #HELP" // #define ASSIGN_IS_OPER_ONLY3 " " // #define ASSIGN_IS_OPER_ONLY4 " " // #define ASSIGN_IS_OPER_ONLY5 " " /* ---------------------------------------------------------------------- */ /* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */ /* ---------------------------------------------------------------------- */ int m_bs_assignoperonly(User *u); int AnopeInit(int argc, char **argv) { Command *c; c = createCommand("ASSIGN", m_bs_assignoperonly, NULL,-1,-1,-1,-1,-1); moduleAddCommand(BOTSERV, c, MOD_HEAD); alog("[bs_assignoperonly] %s ASSIGN command is now restricted to Services Opers and above.", s_BotServ); alog("[bs_assignoperonly] Yayness!(tm) - MODULE LOADED AND ACTIVE"); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); alog("[bs_assignoperonly] This module has loaded and is now active."); return MOD_CONT; } int m_bs_assignoperonly(User *u) { if (is_services_oper(u)) { return MOD_CONT; } #ifdef ASSIGN_IS_OPER_ONLY1 notice(s_BotServ, u->nick, ASSIGN_IS_OPER_ONLY1); #endif #ifdef ASSIGN_IS_OPER_ONLY2 notice(s_BotServ, u->nick, ASSIGN_IS_OPER_ONLY2); #endif #ifdef ASSIGN_IS_OPER_ONLY3 notice(s_BotServ, u->nick, ASSIGN_IS_OPER_ONLY3); #endif #ifdef ASSIGN_IS_OPER_ONLY4 notice(s_BotServ, u->nick, ASSIGN_IS_OPER_ONLY4); #endif #ifdef ASSIGN_IS_OPER_ONLY5 notice(s_BotServ, u->nick, ASSIGN_IS_OPER_ONLY5); #endif return MOD_STOP; }