IRC Giriş Bilgi Modulu (v.5)

IRC Giriş Bilgi Modulu (v.5)
#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 _WIN32
#include "version.h"
#endif
static int m_baglanti(aClient *, aChannel *);


int ibo = 0;
int i;

#define iboname "INFO"
#define bansikayet "#OperHelp"
#define yardim "#Help"
#define OKU "dosyaadi.txt"


char *ibokanallar[7]={
 "#Radyo,#Oyun,#Muhabbet",
 "#istanbul, izmir, #yarisma",
 "#Ankara, #Sanalnikah, #Test",
 "#Bursa, #Diyalog, #Samsun",
 "#Turkiye, #Geyik, #Ayna",
 "#Zurna, #mIRC, #Chat",
 "#Sevgi, #zurna, #Samsun"
};

ModuleHeader MOD_HEADER(m_baglanti)
= {
         "m_baglanti",
 "Kullanici Karsilama ve bilgilendirme. (toXic)",
"Kullanici Karsilama ve bilgilendirme v5 (toXic)",
 "3.2-b8-1",
NULL
};

DLLFUNC int MOD_INIT(m_m_baglanti)(ModuleInfo *modinfo)
{
   HookAddEx(modinfo->handle, HOOKTYPE_LOCAL_CONNECT, m_baglanti);

   return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_m_baglanti)(int module_load)
{
   return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_m_baglanti)(int module_unload)
{
   return MOD_SUCCESS;
}

static int m_baglanti(aClient *sptr, aChannel *chptr) {

sendto_one(sptr, ":%s PRIVMSG %s :Merhaba 2%s2", iboname,  sptr->name, sptr->name);
ibo++;
sendto_one(sptr, ":%s PRIVMSG %s :Sunucuya giren 2%d2 . Kisisiniz.", iboname,  sptr->name, ibo);
sendto_one(sptr, ":%s PRIVMSG %s  :Baglanti bilgileriniz Assagidaki gibidir.", iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :2", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Nickiniz 2%s2", iboname,  sptr->name, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :IP Adresiniz, 2%s2", iboname,  sptr->name, sptr->user->realhost);
sendto_one(sptr, ":%s PRIVMSG %s :IDENTINIZ 2 %s2", iboname,  sptr->name, sptr->user->username);
sendto_one(sptr, ":%s PRIVMSG %s :Baglanti bilgileriniz, Tarih ve saat ile birlikte LOG Alinmistir.", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Sunucu kurallararina uymamaniz takdirde sunucudan uzaklastirilabilirsiniz.", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Baskalarinin 2MSN, FACEBOOK, TWITTER, TEL NUM.2 gibi kisisel bilgilerinin dagitimi suctur.", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :2", iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :2Global  Kanallarimiz;", iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :%s", iboname, sptr->name, AUTO_JOIN_CHANS);
sendto_one(sptr, ":%s PRIVMSG %s :2", iboname,  sptr->name);

           aChannel *chanptr;
sendto_one(sptr, ":%s PRIVMSG %s :2Kanal bilgilerimiz",  iboname, sptr->name);
       if (chanptr = find_channel("#Muhabbet", (aChannel *)NULL)) {
sendto_one(sptr, ":%s PRIVMSG %s :2Muhabbet2 kanali su anda 2%d2 kisi.", iboname, sptr->name, chanptr->users);
             }
       if (chanptr = find_channel("#Radyo", (aChannel *)NULL)) {
sendto_one(sptr, ":%s PRIVMSG %s :2#Radyo2 kanali su anda 2%d2 kisi.", iboname, sptr->name, chanptr->users);
             }
       if (chanptr = find_channel("#Oyun", (aChannel *)NULL)) {
sendto_one(sptr, ":%s PRIVMSG %s :2#Oyun2 kanali su anda 2%d2 kisi.", iboname, sptr->name, chanptr->users);
             }
       if (chanptr = find_channel("#Sohbet", (aChannel *)NULL)) {
sendto_one(sptr, ":%s PRIVMSG %s :2#Sohbet2 kanali su anda 2%d2 kisi.", iboname, sptr->name, chanptr->users);
             }

sendto_one(sptr, ":%s PRIVMSG %s :2", iboname,  sptr->name);

srand ( time(NULL) );
int r = rand()%7;
sendto_one(sptr, ":%s PRIVMSG %s  2Tavsiye edilen Kanallarimiz;",  iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :%s",  iboname,  sptr->name, ibokanallar[r]);


sendto_one(sptr, ":%s PRIVMSG %s :2", iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :IRC Banlari hakkinda sikayet icin 2%s", iboname,  sptr->name, bansikayet );
sendto_one(sptr, ":%s PRIVMSG %s :IRC Komut yardimi icin 2%s2", iboname,  sptr->name, yardim);
sendto_one(sptr, ":%s PRIVMSG %s :Kanallarini kullanabilirsiniz.2", iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :2", iboname,  sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Online 2IRC OPER2 Gorevlilerini gormek icin 2IRCOPS2", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Online 2IRC HELP2 Gorevlilerini gormek icin 2/HELPERS2", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Sunucu yoneticilerinin listesini ve gorevlerini gormek icin 2/MOTD", iboname, sptr->name);
sendto_one(sptr, ":%s PRIVMSG %s :Komutlarini kullanabilirsiniz.", iboname, sptr->name);

      
FILE *dosya;
char buf[BUFSIZE];
dosya = fopen(OKU, "r");
if (dosya != NULL) {
while (fgets(buf, sizeof(buf), dosya)) {
buf[strlen(buf)-1] = 0;
sendto_one(sptr, ":%s PRIVMSG %s :%s", iboname,  sptr->name, buf);
}

return 0;
}

else {
sendto_one(sptr, ":%s PRIVMSG %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", iboname,  sptr->name, buf);
return 0;

                     }

}

Bunlar dişinda birşeyler yazmak için; dosyaadi.txt adli bir dosya hazirlayip yazabilirsiniz.

admin 45
Cevap bırakın