All pastes #792041 Raw Edit

os_kill

public cpp v1 · immutable
·published 2007-11-21 03:20 UTC
rendered paste body
/***************************************************************************************//* Anope Module : os_kill.c : v1.0                                                     *//* Scott Seufert                                                                       *//* katsklaw@ircmojo.net                                                                *//*                                                                                     *//* Anope (c) 2000-2002 Anope.org                                                       *//*                                                                                     *//* This program is free software; you can redistribute it and/or modify it under the   *//* terms of the GNU General Public License as published by the Free Software           *//* Foundation; either version 1, or (at your option) any later version.                *//*                                                                                     *//*  This program is distributed in the hope that it will be useful, but WITHOUT ANY    *//*  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A    *//*  PARTICULAR PURPOSE.  See the GNU General Public License for more details.          *//*                                                                                     *//***************************************************************************************/#include "module.h"#define AUTHOR "katsklaw"#define VERSION "1.1.0"int m_do_kill(User * u);void Module_Help_OPERSERV_KILL(User *u);int Module_Help_OPERSERV_KILL_FULL(User *u);int AnopeInit(int argc, char **argv) { 	Command *c;	c = createCommand("KILL",m_do_kill, is_services_oper,-1,-1,-1,-1,-1);	moduleAddCommand(OPERSERV,c,MOD_HEAD);	moduleAddHelp(c, Module_Help_OPERSERV_KILL_FULL);    	moduleSetOperHelp(Module_Help_OPERSERV_KILL);    	moduleAddAuthor(AUTHOR);    	moduleAddVersion(VERSION);	return MOD_CONT;}void AnopeFini(void) {  alog("Unloading os_kill.so");}void Module_Help_OPERSERV_KILL(User *u){   notice(s_OperServ,u->nick, "    KILL   Has %s kill a user signed by the issuing oper.", s_OperServ);}int Module_Help_OPERSERV_KILL_FULL(User *u){        notice(s_OperServ, u->nick, " Syntax: Kill <nick> <reason>");        notice(s_OperServ, u->nick, "   ");        notice(s_OperServ, u->nick, " Allows Operators to kill a user with %s",s_OperServ);        return MOD_CONT;}int m_do_kill(User * u){    char *argv[2];    char *nick, *s;    nick = strtok(NULL, " ");    s = strtok(NULL, "");    anope_cmd_svskill(s_OperServ, nick, "Killed (%s %s)", u->nick, s);    if (WallOSAkill)        anope_cmd_global(s_OperServ, "%s used Kill on %s", u->nick,                         nick);    argv[0] = sstrdup(s);	else		notice(s_OperServ, u->nick, "Permission Denied");    argv[1] = sstrdup(nick);    argv[2] = sstrdup(s);    free(argv[1]);    free(argv[0]);    return MOD_CONT;}/* EOF */