Module help

These are old archives. They are kept for historic purposes only.
Post Reply
ShawnPrend
Posts: 4
Joined: Sun Feb 01, 2009 10:16 pm

Module help

Post by ShawnPrend » Thu Jun 11, 2009 4:32 am

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);
}
I'm bad I know

Jobe1986
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Module help

Post by Jobe1986 » Fri Jun 12, 2009 3:46 pm

Forgive me for seeming dumb, but what's wrong with /helpop <message>?
Your IP: Image

katsklaw
Official supporter
Posts: 1114
Joined: Sun Apr 18, 2004 5:06 pm

Re: Module help

Post by katsklaw » Fri Jun 12, 2009 6:33 pm

Jobe1986 wrote:Forgive me for seeming dumb, but what's wrong with /helpop <message>?
Nothing is wrong with /helpop, unless it doesn't fill your needs.

This module:
1> it's a different solution.
2> seeing /helpop requires umode +h, being in a +si channel doesn't
3> this module can be duplicated to allow for multiple "helper" types (channel services, admin services, kline support, mass spam .. etc) without mixing all of them together in /helpop
4> because they can :wink:

One could also relativity easily add more modes to memory space, assign flags to said modes and duplicate the helpop system for each new mode/flag.

Post Reply