Bu modülü, Shell firmanıza kurduğunuzda kullanıcılar, arası özel mesajlaşmayı engellemiş olursunuz. Sadece oper statüsünde olan kişilere yazabilmeleri sağlanmıştır.
usermsg.c modülü;
Kod :
#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
#define ACIKLAMA "Kullanıcılar arası özel mesaj engeli by Entrance"
DLLFUNC char *m_usermsg(aClient *, aClient *, aClient *, char *, int);
ModuleHeader MOD_HEADER(m_usermsg)
= {
"m_usermsg.c",
ACIKLAMA,
ACIKLAMA,
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_usermsg)(ModuleInfo *modinfo)
{
HookAddPCharEx(modinfo->handle, HOOKTYPE_USERMSG, m_usermsg);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_usermsg)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_usermsg)(int module_unload)
{
return MOD_SUCCESS;
}
DLLFUNC char *m_usermsg(aClient *cptr, aClient *hms, aClient *hm, char *mesaj, int notice)
{
if(!IsULine(hm) && !IsServer(hms) && !IsAnOper(hms) && !IsAnOper(hm))
{
sendto_one(hms,":%s NOTICE %s :Kullanıcılar arası özel mesaj engellenmiştir. Shell yetkililerine yazınız..", me.name, hms->name);
return NULL;
} else
return mesaj;
}
“İnsanların en hayırlısı, insanlara faydalı olandır”. H.Ş.