Code: Select all
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC CMD_FUNC(m_calloper);
#define MSG_CALLOPER "calloper"
#define TOK_CALLOPER "CAO"
static Command *calloper;
ModuleHeader MOD_HEADER(m_calloper)
= {
"m_calloper",
"$Id: m_calloper.c,v 1.1 June 10 2008 15:15:22 Shawn Exp $",
"command /calloper",
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_calloper)(ModuleInfo *modinfo)
{
calloper = CommandAdd(modinfo->handle, MSG_CALLOPER, TOK_CALLOPER, m_calloper, MAXPARA, M_USER|M_SERVER);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_calloper)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_calloper)(int module_unload)
{
CommandDel(calloper);
return MOD_SUCCESS;
}
DLLFUNC CMD_FUNC(m_calloper)
{
aClient *acptr;
char *message;
char *reason;
message = parc > 2 ? parv[1] : NULL;
reason = parv[2];
if (BadPtr(message))
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, sptr->name,
"CALLOPER");
return 0;
}
sendto_realops("[\2HELP\2] [By: %s] [Channel: %s] [Reason: %s]",
sptr->name, message, reason);
}