Kod: Kodu kopyalamak için üzerine çift tıklayın!
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.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
#ifndef DYNAMIC_LINKING
ModuleHeader m_yasakla_Header
#else
#define m_yasakla_Header Mod_Header
ModuleHeader Mod_Header
#endif
= {
"Kullanici ozel yasaklama..",
"yasak.c",
"Kullanici ozel yasaklama..",
"3.2-b8-1",
NULL
};
static long UMODE_YASAKLA = 0;
static Umode *Umodeyasakla = NULL;
static Hook *CheckMsg;
DLLFUNC char *yasakla_checkmsg(aClient *, aClient *, aClient *, char *, int);
DLLFUNC int MOD_INIT(m_yasakla)(ModuleInfo *modinfo)
{
if (!Umodeyasakla)
{
config_error("m_yasakla: Could not add usermode 'Q': %s", ModuleGetErrorStr(modinfo->handle));
return MOD_FAILED;
}
CheckMsg = HookAddPCharEx(modinfo->handle, HOOKTYPE_USERMSG, yasakla_checkmsg);
ModuleSetOptions(modinfo->handle, MOD_OPT_PERM);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_yasakla)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_yasakla)(int module_unload)
{
return MOD_SUCCESS;
}
DLLFUNC char *yasakla_checkmsg(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
if ((sptr->umodes & UMODE_YASAKLA) && !IsAnOper(sptr) && !IsULine(sptr) && !IsServer(sptr))
{
sendnotice(sptr, " '%s' Yasaklisiniz..", sptr->name);
return NULL;
} else
return text;
}
privdeaf sistemindeki gibi Kullaniciya mode verip yasaklayabilirsiniz.