
/* Main NickServ module.
 *
 * IRC Services is copyright (c) 1996-2009 Andrew Church.
 *     E-mail: <achurch@achurch.org>
 * Parts written by Andrew Kempe and others.
 * This program is free but copyrighted software; see the file COPYING for
 * details.
 */

#include "services.h"
#include "modules.h"
#include "conffile.h"
#include "language.h"
#include "commands.h"
#include "encrypt.h"
#include "modules/operserv/operserv.h"
#include "modules/chanserv/chanserv.h"

#include "nickserv.h"
#include "ns-local.h"

#define SUNUCU "ChatAskim.Net"



char last_begen_nick[NICKMAX];
char last_profil_nick[NICKMAX];
char last_durt_nick[NICKMAX];
char last_tanis_nick[NICKMAX];
char last_identify_nick[NICKMAX];
char last_info_nick[NICKMAX];

char last_tweet_nick[NICKMAX];
char last_durum_nick[NICKMAX];
char last_points_nick[NICKMAX];
char last_sans_nick[NICKMAX];
char last_alist_nick[NICKMAX];
char last_vhostlist_nick[NICKMAX];

char last_vhost_nick[NICKMAX];
char last_yas_nick[NICKMAX];
char last_burc_nick[NICKMAX];
char last_sehir_nick[NICKMAX];
char last_takim_nick[NICKMAX];
char last_durum_nick[NICKMAX];
char last_tweet_nick[NICKMAX];
char last_drop_nick[NICKMAX];

char last_,identify_chan[CHANMAX];
char last_cstopic_chan[CHANMAX];
char last_info_chan[CHANMAX];
char last_register_chan[CHANMAX];
char last_memo_nick[NICKMAX];
char last_ajoin_nick[NICKMAX];
char last_link_nick[NICKMAX];

char last_sarap_nick[NICKMAX];
char last_hamburger_nick[NICKMAX];
char last_viski_nick[NICKMAX];
char last_pasta_nick[NICKMAX];
char last_kahve_nick[NICKMAX];
char last_opucuk_nick[NICKMAX];
char last_tokat_nick[NICKMAX];
char last_raki_nick[NICKMAX];
char last_cay_nick[NICKMAX];
char last_bira_nick[NICKMAX];
char last_saydek_nick[NICKMAX];
char last_redbull_nick[NICKMAX];
char last_pizza_nick[NICKMAX];
char last_emzik_nick[NICKMAX];
char last_kola_nick[NICKMAX];
char last_sigara_nick[NICKMAX];
char last_tekme_nick[NICKMAX];
char last_yumruk_nick[NICKMAX];
char last_kafa_nick[NICKMAX];
char last_tekila_nick[NICKMAX];
char last_tesekkur_nick[NICKMAX];

#define XOP_LISTNAME(level) \
    ((level)==ACCLEV_SOP ? " (SOP)" : (level)==ACCLEV_AOP ? " (AOP)" : \
        (level)==ACCLEV_HOP ? " (HOP)" : (level)==ACCLEV_VOP ? " (VOP)" : " ")

char *ibofallar[28]={
"Elalemi takma sen. Sadece Ona guven. Seni sevdigini soyluyor, birazcik karsilik versen..",
"Durmadan bakiyor, seni gormezden geliyor. Birgun seni gorecek, o sirma sacli melek.",
"Takma kafana onu, burcundan belli ne oldugu. Geri donup bakacak, Sanma seni bulacak..",
"Gun gelir gidersin, yine onu seversin. Yas problem degil, yeterki gonul sevsin..",
"Masum gibi gorunme, insani deli etme. Neden boyle yaparsin, anlamadim melekmisin? Seytanmisin?",
"O kuserse sende daril, sarilmak isterse saril. Ask oyunu derler buna, Haydi durma sende katil!",
"Bakma bana oyle melul melul, goren seni masum sanir. Takmis koluna birini geziyor, el ne der bilmiyor!",
"Gel benimle bu sabah, cikalim sahil boyuna. Ben seni, sen beni al. Varalim muradimiza..",
"Bu yol ankara yolu, ne basi var ne sonu. Askini soylemezsen; unutursun sen onu.",
"Yarim gelir uzaktan, bakarim ben balkondan. Annem duymasin aman, dusmez sonra yakamdan.",
"Guzelim baksana sen bi bana, hasta olurum ben sana. Senin gibi liseli gormedim bu dunyada.",
"Yari almis koluna, varmis sahil boyuna. Nisan vakti pek yakin, adam olan olana.",
"Balik gibi kivrilir, saat gibi sallanir. Yari guzel olanin; adimlari sallanir.",
"Dersini calismissin, ezberin pek kuvvetli. Gelip beni istemezsen, kalacaksin yuzustu.",
"Sahil boyu gezerim, seni ben cok severim. Tavsan fali neyime, benim olsun isterim..",
"Dudaklarin kirmizi, saclarin uzun sari. Fazla gezme yollarda, kacirirlar bak sonra..",
"Para diye beklersin, Dua eder istersin. Hadi gozunuz aydin, geleni sayamazsin..",
"Adam gibi adamsan, askini anlatirsan. Oda sever seni, daha oyalanmazsan..",
"Buralar kuru dere, yangin var yar sevene. Ben yandim siz yanmayin, buyrun dugun geceme.",
"Masum kelebek, insan degil sanki melek. Nasil anlatsak az gelir, asik midir nedir?",
"Meshur izmirin kemeri, ordadir kismetin isyeri. Bu sezon cok ilerlemis, turizm seyehat isleri.",
"Hickirik tuttu beni, tuttu furutti beni.  Elin oglu degilmi? Gitti unuttu beni.",
"Camda durmus yol izler, Aklinda sirlar gizler. Bunu okuyan kerizler, bulacak birer ikizler.",
"Sevdicegin basaktir. Yalniz biraz ****tir. Derhal terket onu, birak. Karsina cikacak zengin bir oglak.",
"Evlat, sen bir yaysin. Henuz cok ufak taysin. Kendine gel kocum, yoksa vuracak mayk taysin.",
"Gelecekler nikah diye, ellerinde bir hediye. Dugununde basilacak, 350 davetiye.",
"Bugun bulacak seni, begenecek gozlerini. Daha kis bitmeden, hapsedecek kalbine seni..",
"Haydi kalksana chat basindan. Disarda mis gibi bir hava, cik soyle bir dolan, ismarlayacak hamsi tava.",
};

char *iborsozler[39]={
"Deniz ne kadar dalgali olsa sonunda durulur. (GOETHE)",
"Ihanetin kucugu buyugu olmaz. (HZ.ISA)",
"Tarih,hukumdarlarin en iyi danismanidir. (T. CARLYL)",
"Mezarliklar toplum icin gerekli insanlarla doludur. (Charles de Gaulle)",
"Iyilik hicbir zaman cezasiz kalmaz. (Gore Vidal)",
"Ihtiyac, icatlarin anasidir. (WILLIAM WYCERLEY)",
"Gomlegin ilk dugmesi yanlis iliklenince digerleri de yanlis gider. (C.BRUNO)",
"Hayat yasanti aramak degil kendimizi aramaktir. (C.PAVESE)",
"Bu dahil butun genellemeler yanlistir. (F.NIETZSCHE)",
"Insan, ucurumun kenarina varmadan kanatlanmaz. (KAZANCAKIS)",
"Vicdani tertemizdi cunku onu hic kullanmamisti. (S.LEC)",
"Insan ancak anladigi seyler duyar. (GOETHE)",
"Kaptanin ustaligi deniz durgunken anlasilmaz. (LUKIANOS)",
"Iyi dostu olanin aynaya gereksinimi yoktur. (Mevlana)",
"Ruyalari gerceklestirmenin en iyi yolu uyanmaktir. (S. M. Power)",
"Acinmaktansa, Kiskanilmak daha iyidir. (HERODOT)",
"Herseyi denerim; ama yapabildiklerimi yaparim.. (Herman Melville)",
"Askin gizemi, olumun gizeminden daha buyuktur. (Oscar Wilde)",
"Adalet olmadan duzen olmaz. (Albert CAMUS)"
"Adaleti, aklin yardimi olmadan kullanmak imkansizdir. (FREUDE)",
"Adalet, once devletten gelir. (ARISTO)",
"TANRININ degirmeni agir ama iyi ogutur. (GEORGE HERBERT)",
"Genclikte, guzellikte akil arama. (HOMEROS)",
"Aklinda gor, Kalbinle isit. (Turk Atasozu)",
"Ancak, kendi kendini idare edebilen akilli insanlar hurdur. (HORACE)",
"Arkadas, sizin hoslanmadiginiz kimselerden hoslanmayan insandir. (ANONIM)",
"Ana-babalarimiz tesadufle, arkadaslarimiz secimle kazanilir. (DELILLE)",
"Arkadas edinmenin tek yolu, arkadas olmaktir. (EMERSON)",
"Arkadaslik yapilmaz, dogar. (H. B. ADAMS)",
"Akilsiz basin cezasini ayaklar ceker. (TURK Atasozu)",
"Herseyin baslangici kucuktur. (CICERO)",
"Iyi bitirmek, iyi baslamaktan daha ustundur. (OVIDIUS)",
"Baslangici olan birsey nasil olsa biter. (OUINTILIAN)",
"Aptallar, eski olaylari hatirlamayi, bir bilim sayarlar. (PLANCHE)",
"Borc, en kotu yoksulluktur. (M. G. LICHTWER)",
"Borc, dipsiz bir denizdir. (CARLYLE)",
"Borc yiyen, kesesinden yer. (TURK Atasozu)",
"Cesaretle dolu bir insan, inancla dolu olan insandir. (CICERO)",
"Cesaret, butun silahlardan ustundur. (OVIDIUS)",
"Ormanda en cok sesi maymunlar cikarsada, kral her zaman aslandir. (toXic)",
};


char *kanal[19]={
"#sohbet",
"#Radyo",
};

char *oyun[10]={
"#Oyun",
"#kelime",
};

char *iborand[21]={
"Bugun Sansli gununuzdemisiniz? Denemek icin /NS Sans Komutunu kullaniniz.",
"Services uzerindeki bazi istatistikleri, /Services STATS Komutu ile takip edebilirsiniz.",
"DURUM Belirtmek icin /DURUM MESAJ Komutununu kullaniniz. Ornek; /DURUM Disari cikiyorum.",
"Profil bilgileri girip kendinizi daha iyi ifade edebilmek icin, /NS Profilinfo Komutunu kullaniniz.",
"Kendinizin veya birbaskasinin profilini gorebilmek icin,  /NS Profil NICK Komutunu uygulayiniz.",
"Baskalarinin durumunu gormek icin, /NS PROFIL NICK komutunu uygulayiniz.",
"Istek,Oneri,Sikayetlerinizi /NS istek isteginiz, /NS Sikayet sikayetiniz, /NS Oneri oneriniz komutlariyla bildirebilirsiniz.",
"Kullanicilarin puanini gormek icin /NS Points NICK Komutunu kullaniniz.",
"Info ve profil bilgilerinizi kapatmak icin /NS SET Private ON Komutunu kullaniniz.",
"Vhost secmek icin /NS VhostHelp komutu ile bilgi alabilirsiniz.",
"Random bir kanala girmek istiyorsaniz /NS Kanal komutunu kullaniniz.",
"Nickinize ekli accessleri gormek icin, /NS Alist Komutunu uygulayiniz.",
"IRC uzerine tweet atmak icin, /NS SET TWEET mesajiniz Komutunu uygulayiniz.",
"Bir baskasinin attigi tweeti gormek istiyorsaniz, /NS PROFIL NICK Komutunu uygulayiniz.",
"TWEET, SEHIR, YAS, BURC, TAKIM, DURUM, VHOST bilgilerini gormek icin, /NS PROFIL NICK Komutunu uygulayiniz.",
"Bir arkadasinizi durtmek icin, /NS DURT NICK Komutunu uygulayiniz.",
"Isminizi belirtmek istiyorsaniz, /isim isminiz  Komutunu uygulayiniz.",
"Bir Kullanicinin PROFILINI Begendiyseniz, /NS Begen NICK Komutunu uygulayiniz.",
"Hediye gondermek icin, /NS HEDIYE URUN NICK yaziniz.",
"Hediye hakkinda ayrintili bilgi icin, /NS HEDIYE HELP Yaziniz.",
"Hediye marketimizi gormek icin /Services MARKET yaziniz.",
};



/*************************************************************************/

static Module *module;

static int cb_command       = -1;
static int cb_help          = -1;
static int cb_help_cmds     = -1;
       int cb_reglink_check = -1;  /* called from util.c */
static int cb_registered    = -1;
static int cb_id_check      = -1;
static int cb_identified    = -1;

static int db_opened = 0;

       char *s_NickServ;
       char *s_ChanServ;
static char *desc_NickServ;
static char *NickDBName;
EXPORT_VAR(char *,s_NickServ)

       int32  NSRegEmailMax;
       int    NSRequireEmail;
       time_t NSRegDelay;
       time_t NSInitialRegDelay;
       int32  NSDefFlags;
       time_t NSExpire;
       time_t NSExpireWarning;
       int    NSShowPassword;
       char * NSEnforcerUser;
       char * NSEnforcerHost;
       int    NSForceNickChange;
       time_t NSReleaseTimeout;
       int    NSAllowKillImmed;
       int    NSListOpersOnly;
       int32  NSListMax;
       int    NSSecureAdmins;
       time_t NSSuspendExpire;
       time_t NSSuspendGrace;
static int    NSHelpWarning;
static int    NSEnableDropEmail;
static time_t NSDropEmailExpire;

/*************************************************************************/

static void do_help(User *u);
static void do_komutlar(User *u);
static void do_ident(User *u, char *param);
static void do_botkill(User *u);
static void do_gollum(User *u);
static void do_bomba(User *u);
static void do_stats(User *u);
static void do_durt(User *u);
static void do_tanisaaa(User *u);
static void do_begen(User *u);
static void do_alist(User *u);
static void do_cicek(User *u);
static void do_register(User *u);
static void do_check(User *u);
static void do_durum(User *u);
static void do_tweet(User *u);
static void do_histek(User *u);
static void do_durumlar(User *u);
static void do_tweetler(User *u);
static void do_vhosthelp(User *u);
static void do_vhostlist(User *u);
static void do_tesekkuraaa(User *u);
static void do_market(User *u);
static void do_hediye(User *u);
static void do_iliskiler(User *u);
static void do_isim(User *u, char *param);
static void do_kills(User *u);
static void do_killist(User *u);
static void do_points(User *u);
static void do_toxic(User *u);
static void do_identify(User *u);
static void do_sans(User *u);
static void do_kanal(User *u);
static void do_oneri(User *u);
static void do_oneriler(User *u);
static void do_istek(User *u);
static void do_istekler(User *u);
static void do_sikayet(User *u);
static void do_sikayetler(User *u);
static void do_ozellikler(User *u);
static void do_nickinfo(User *u);
static void do_operules(User *u);
static void do_opersrules(User *u);
static void do_drop(User *u);
static void do_dropnick(User *u);
static void do_dropemail(User *u);
static void do_dropemail_confirm(User *u);
static void do_info(User *u);
static void do_sehirler(User *u);
static void do_burclar(User *u);
static void do_yaslar(User *u);
static void do_takimlar(User *u);
static void do_profilinfo(User *u);
static void do_profil(User *u);
static void do_pointlist(User *u);
static void do_listchans(User *u);
static void do_list(User *u);
static void do_listemail(User *u);
static void do_recover(User *u);
static void do_release(User *u);
static void do_ghost(User *u);
static void do_status(User *u);
static void do_getpass(User *u);
static void do_forbid(User *u);
static void do_suspend(User *u);
static void do_unsuspend(User *u);
#ifdef DEBUG_COMMANDS
static void do_listnick(User *u);
#endif

/*************************************************************************/

static Command cmds[] = {
    { "HELP",     do_help,     NULL,  -1,                     -1,-1 },
    { "REGISTER", do_register, NULL,  NICK_HELP_REGISTER,     -1,-1 },
    { "SEHIRLER", do_sehirler, NULL, -1, -1,-1 },
    { "BURCLAR", do_burclar, NULL, -1, -1,-1 },
    { "YASLAR", do_yaslar, NULL, -1, -1,-1 },
    { "TAKIMLAR", do_takimlar, NULL, -1, -1,-1 },
    { "PROFILINFO", do_profilinfo, NULL, -1, -1,-1 },
    { "PROFIL", do_profil, NULL, -1, -1,-1 },
    { "POINTLIST", do_pointlist, NULL, -1, -1,-1 },
    { "SANS", do_sans, NULL, -1, -1,-1 },
    { "CICEK", do_cicek, NULL, -1, -1,-1 },
    { "KANAL", do_kanal, NULL, -1, -1,-1 },
    { "IDENTIFY", do_identify, NULL,  NICK_HELP_IDENTIFY,     -1,-1 },
    { "CHECK", do_check, NULL, -1, -1,-1 },
    { "DURUM", do_durum, NULL, -1, -1,-1 },
    { "TWEET", do_tweet, NULL, -1, -1,-1 },  
    { "TOXIC", do_toxic, NULL, -1, -1,-1 },
    { "ILISKILER", do_iliskiler, NULL, -1, -1,-1 },
    { "ISIM", do_isim, NULL, -1, -1,-1 },
    { "TESEKKURAAA", do_tesekkuraaa, NULL, -1, -1,-1 },
    { "MARKET", do_market, NULL, -1, -1,-1 },
    { "HEDIYE", do_hediye, NULL, -1, -1,-1 },
    { "HISTEK", do_histek, NULL, -1, -1,-1 },
    { "ALIST", do_alist, NULL, -1, -1, -1 },
    { "STATS", do_stats, NULL, -1, -1, -1 },
    { "DURT", do_durt, NULL, -1, -1, -1 },
    { "TANISAAA", do_tanisaaa, -1, -1, -1, -1 },
    { "BEGEN", do_begen, NULL, -1, -1, -1 },
    { "GOLLUM", do_gollum, NULL, -1, -1, -1 },
    { "BOTKILL", do_botkill, NULL, -1, -1, -1 },
    { "BOMBA", do_bomba, NULL, -1, -1, -1 },   
    { "KOMUTLAR", do_komutlar, NULL, -1, -1, -1 },
    { "IDENT", do_ident, NULL, -1, -1, -1 },
    { "DURUMLAR", do_durumlar, NULL, -1, -1,-1 },
    { "TWEETLER", do_tweetler, NULL, -1, -1,-1 },
    { "VHOSTHELP", do_vhosthelp, NULL, -1, -1,-1 },
    { "VHOSTLIST", do_vhostlist, NULL, -1, -1,-1 },
    { "KILLS", do_kills, NULL, -1, -1,-1 },
    { "KILLIST", do_killist, NULL, -1, -1,-1 },
    { "POINTS", do_points, NULL, -1, -1,-1 },
    { "SIDENTIFY",do_identify, NULL,  -1,                     -1,-1 },
    { "DROP",     do_drop,     NULL,  NICK_HELP_DROP,         -1,-1 },
    { "ISTEK",     do_istek,     NULL,  -1,         -1,-1 },
    { "SIKAYET",     do_sikayet,     NULL,  -1,         -1,-1 },
    { "ONERI",     do_oneri,     NULL,  -1,         -1,-1 },
    { "ISTEKLER",     do_istekler,     NULL,  -1,         -1,-1 },
    { "ONERILER",     do_oneriler,     NULL,  -1,         -1,-1 },
    { "SIKAYETLER",     do_sikayetler,     NULL,  -1,         -1,-1 },
    { "OZELLIKLER",     do_ozellikler,     NULL,  -1,         -1,-1 },
    { "NICKINFO",     do_nickinfo,     NULL,  -1,         -1,-1 },
    { "OPERULES",     do_operules,     NULL,  -1,         -1,-1 }, 
    { "OPERSRULES",     do_opersrules,     NULL,  -1,         -1,-1 },
    { "SET",      do_set,      NULL,  NICK_HELP_SET,
		-1, NICK_OPER_HELP_SET },
    { "SET PASSWORD", NULL,    NULL,  NICK_HELP_SET_PASSWORD, -1,-1 },
    { "SET URL",      NULL,    NULL,  NICK_HELP_SET_URL,      -1,-1 },
    { "SET EMAIL",    NULL,    NULL,  NICK_HELP_SET_EMAIL,    -1,-1 },
    { "SET INFO",     NULL,    NULL,  NICK_HELP_SET_INFO,     -1,-1 },
    { "SET YAS",      NULL,    NULL,  -1,      -1,-1 },
    { "SET BURC",     NULL,    NULL,  -1,     -1,-1 },
    { "SET SEHIR",     NULL,    NULL,  -1,     -1,-1 },
    { "SET TAKIM",     NULL,    NULL,  -1,     -1,-1 },  
    { "SET DURUM",     NULL,    NULL,  -1,     -1,-1 },
    { "SET ILISKINICK",     NULL,    NULL,  -1,     -1,-1 },
    { "SET ILISKI",     NULL,    NULL,  -1,     -1,-1 },
    { "SET BAYRAK",     NULL,    NULL,  -1,     -1,-1 },
    { "SET TWEET",     NULL,    NULL,  -1,     -1,-1 },
    { "SET HELPER",   NULL,    NULL,    -1 -1,-1 },
    { "SET PATRIOT",   NULL,    NULL,    -1 -1,-1 },
    { "SET KILL",     NULL,    NULL,  NICK_HELP_SET_KILL,     -1,-1 },
    { "SET SECURE",   NULL,    NULL,  NICK_HELP_SET_SECURE,   -1,-1 },
    { "SET PRIVATE",  NULL,    NULL,  NICK_HELP_SET_PRIVATE,  -1,-1 },
    { "SET HIDE",     NULL,    NULL,  NICK_HELP_SET_HIDE,     -1,-1 },
    { "SET TIMEZONE", NULL,    NULL,  NICK_HELP_SET_TIMEZONE, -1,-1 },
    { "SET NOEXPIRE", NULL,    NULL,  -1, -1,
		NICK_OPER_HELP_SET_NOEXPIRE },
    { "UNSET",    do_unset,    NULL,  NICK_HELP_UNSET,
		-1, NICK_OPER_HELP_UNSET },
    { "RECOVER",  do_recover,  NULL,  NICK_HELP_RECOVER,      -1,-1 },
    { "RELEASE",  do_release,  NULL,  NICK_HELP_RELEASE,      -1,-1 },
    { "GHOST",    do_ghost,    NULL,  NICK_HELP_GHOST,        -1,-1 },
    { "INFO",     do_info,     NULL,  NICK_HELP_INFO,
		-1, NICK_OPER_HELP_INFO },
    { "LIST",     do_list,     NULL,  -1,
		NICK_HELP_LIST, NICK_OPER_HELP_LIST },
    { "LISTEMAIL",do_listemail,NULL,  -1,
		NICK_HELP_LISTEMAIL, NICK_OPER_HELP_LISTEMAIL },
    { "STATUS",   do_status,   NULL,  NICK_HELP_STATUS,       -1,-1 },
    { "LISTCHANS",do_listchans,NULL,  NICK_HELP_LISTCHANS,
		-1, NICK_OPER_HELP_LISTCHANS },

    { "DROPNICK", do_dropnick, is_services_admin, -1,
		-1, NICK_OPER_HELP_DROPNICK },
    { "DROPEMAIL",do_dropemail,is_services_admin, -1,
		-1, NICK_OPER_HELP_DROPEMAIL },
    { "DROPEMAIL-CONFIRM", do_dropemail_confirm, is_services_admin, -1,
		-1, NICK_OPER_HELP_DROPEMAIL },
    { "GETPASS",  do_getpass,  is_services_admin, -1,
		-1, NICK_OPER_HELP_GETPASS },
    { "FORBID",   do_forbid,   is_services_admin, -1,
		-1, NICK_OPER_HELP_FORBID },
    { "SUSPEND",  do_suspend,  is_services_admin, -1,
		-1, NICK_OPER_HELP_SUSPEND },
    { "UNSUSPEND",do_unsuspend,is_services_admin, -1,
		-1, NICK_OPER_HELP_UNSUSPEND },
#ifdef DEBUG_COMMANDS
    { "LISTNICK", do_listnick, is_services_admin, -1, -1, -1 },
#endif
    { NULL }
};

/*************************************************************************/
/************************ Main NickServ routines *************************/
/*************************************************************************/

/* Introduce the NickServ pseudoclient. */

static int introduce_nickserv(const char *nick)
{
    if (!nick || irc_stricmp(nick, s_NickServ) == 0) {
	char modebuf[BUFSIZE];
	snprintf(modebuf, sizeof(modebuf), "o%s", pseudoclient_modes);
	send_nick(s_NickServ, ServiceUser, ServiceHost, ServerName,
		  desc_NickServ, modebuf);
	return nick ? 1 : 0;
    }
    return 0;
}

/*************************************************************************/

/* Main NickServ routine. */

static int nickserv(const char *source, const char *target, char *buf)
{
    char *cmd;
    User *u = get_user(source);

    if (irc_stricmp(target, s_NickServ) != 0)
	return 0;

    if (!u) {
	module_log("user record for %s not found", source);
	notice(s_NickServ, source,
		getstring(NULL, INTERNAL_ERROR));
	return 1;
    }

    cmd = strtok(buf, " ");

    if (!cmd) {
	return 1;
    } else if (stricmp(cmd, "\1PING") == 0) {
	const char *s;
	if (!(s = strtok(NULL, "")))
	    s = "\1";
	notice(s_NickServ, source, "\1PING %s", s);
    } else {
	if (call_callback_2(module, cb_command, u, cmd) <= 0)
	    run_cmd(s_NickServ, u, module, cmd);
    }
    return 1;

}

/*************************************************************************/

/* Return a /WHOIS response for NickServ. */

static int nickserv_whois(const char *source, char *who, char *extra)
{
    if (irc_stricmp(who, s_NickServ) != 0)
	return 0;
    send_cmd(ServerName, "311 %s %s %s %s * :%s", source, who,
	     ServiceUser, ServiceHost, desc_NickServ);
    send_cmd(ServerName, "312 %s %s %s :%s", source, who,
	     ServerName, ServerDesc);
    send_cmd(ServerName, "313 %s %s :is a network service", source, who);
    send_cmd(ServerName, "318 %s %s End of /WHOIS response.", source, who);
    return 1;
}

/*************************************************************************/

/* Save nickname database. */

static int do_save_data()
{
    sync_nick_db(NickDBName);
    return 0;
}

/*************************************************************************/
/*************************************************************************/

/* Callback for users connecting to the network. */

static int do_user_create(User *user, int ac, char **av)
{
    validate_user(user);
    return 0;
}

/*************************************************************************/

/* Callbacks for users changing nicknames (before and after). */

static int do_user_nickchange_before(User *user, const char *newnick)
{
    /* Changing nickname case isn't a real change; pop out immediately
     * in that case. */
    if (irc_stricmp(newnick, user->nick) == 0)
	return 0;

    cancel_user(user);
    return 0;
}

static int do_user_nickchange_after(User *user, const char *oldnick)
{
    /* Changing nickname case isn't a real change; pop out immediately
     * in that case. */
    if (irc_stricmp(oldnick, user->nick) == 0)
	return 0;

    user->my_signon = time(NULL);
    validate_user(user);
    if (usermode_reg) {
	if (user_identified(user)) {
	    send_cmd(s_NickServ, "SVSMODE %s :+%s", user->nick,
		     mode_flags_to_string(usermode_reg, MODE_USER));
	    user->mode |= usermode_reg;
	} else {
	    send_cmd(s_NickServ, "SVSMODE %s :-%s", user->nick,
		     mode_flags_to_string(usermode_reg, MODE_USER));
	    user->mode &= ~usermode_reg;
	}
    }
    return 0;
}
  
/*************************************************************************/

/* Callback for users disconnecting from the network. */

static int do_user_delete(User *user, const char *reason)
{
    NickInfo *ni = user->ni;
    int i, j;

    if (user_recognized(user)) {
	free(ni->last_quit);
	ni->last_quit = *reason ? sstrdup(reason) : NULL;
	put_nickinfo(ni);
    }
    ARRAY_FOREACH (i, user->id_nicks) {
	NickGroupInfo *ngi = get_ngi_id(user->id_nicks[i]);
	if (!ngi)
	    continue;
	ARRAY_SEARCH_PLAIN_SCALAR(ngi->id_users, user, j);
	if (j < ngi->id_users_count) {
	    ARRAY_REMOVE(ngi->id_users, j);
	} else {
	    module_log("BUG: do_user_delete(): nickgroup %u listed in"
		       " id_nicks for user %p (%s), but user not in"
		       " id_users!", ngi->id, user, user->nick);
	}
    }
    cancel_user(user);
    return 0;
}

/*************************************************************************/

/* Callback for REGISTER/LINK check; we disallow registration/linking of
 * the NickServ pseudoclient nickname or guest nicks.  This is done here
 * instead of in the routines themselves to avoid duplication of code at an
 * insignificant performance cost.
 */

static int do_reglink_check(const User *u, const char *nick,
			    const char *pass, const char *email)
{
    if ((protocol_features & PF_CHANGENICK) && is_guest_nick(nick)) {
	/* Don't allow guest nicks to be registered or linked.  This check
	 * has to be done regardless of the state of NSForceNickChange
	 * because other modules might take advantage of forced nick
	 * changing. */
	return 1;
    }
    return irc_stricmp(nick, s_NickServ) == 0;
}

/*************************************************************************/
/*********************** NickServ command routines ***********************/
/*************************************************************************/

/* Return a help message. */

static void do_help(User *u)
{
    char *cmd = strtok_remaining();

    if (!cmd) {
	notice_help(s_NickServ, u, NICK_HELP);
	if (NSExpire)
	    notice_help(s_NickServ, u, NICK_HELP_EXPIRES,
			maketime(u->ngi,NSExpire,0));
	if (NSHelpWarning)
	    notice_help(s_NickServ, u, NICK_HELP_WARNING);
    } else if (call_callback_2(module, cb_help, u, cmd) > 0) {
	return;
    } else if (stricmp(cmd, "COMMANDS") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_COMMANDS);
	if (find_module("nickserv/mail-auth"))
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_AUTH);
	notice_help(s_NickServ, u, NICK_HELP_COMMANDS_IDENTIFY);
	if (find_module("nickserv/sendpass"))
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_SENDPASS);
	notice_help(s_NickServ, u, NICK_HELP_COMMANDS_DROP);
	if (find_module("nickserv/link"))
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_LINK);
	if (find_module("nickserv/oldlink"))
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_OLDLINK);
	if (find_module("nickserv/access"))
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_ACCESS);
	if (find_module("nickserv/autojoin"))
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_AJOIN);
	notice_help(s_NickServ, u, NICK_HELP_COMMANDS_SET);
	if (!NSListOpersOnly)
	    notice_help(s_NickServ, u, NICK_HELP_COMMANDS_LIST);
	notice_help(s_NickServ, u, NICK_HELP_COMMANDS_LISTCHANS);
	call_callback_2(module, cb_help_cmds, u, 0);
	if (is_oper(u)) {
	    notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS);
	    if (NSEnableDropEmail)
		notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS_DROPEMAIL);
	    if (EnableGetpass)
		notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS_GETPASS);
	    notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS_FORBID);
	    if (find_module("nickserv/oldlink"))
		notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS_LISTLINKS);
	    if (NSListOpersOnly)
		notice_help(s_NickServ, u, NICK_HELP_COMMANDS_LIST);
	    if (find_module("nickserv/mail-auth"))
		notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS_SETAUTH);
	    call_callback_2(module, cb_help_cmds, u, 1);
	    notice_help(s_NickServ, u, NICK_OPER_HELP_COMMANDS_END);
	}
    } else if (stricmp(cmd, "REGISTER") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_REGISTER,
		    getstring(u->ngi,NICK_REGISTER_SYNTAX));
	notice_help(s_NickServ, u, NICK_HELP_REGISTER_EMAIL);
	notice_help(s_NickServ, u, NICK_HELP_REGISTER_END);
    } else if (stricmp(cmd, "DROP") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_DROP);
	if (find_module("nickserv/link") || find_module("nickserv/oldlink"))
	    notice_help(s_NickServ, u, NICK_HELP_DROP_LINK);
	notice_help(s_NickServ, u, NICK_HELP_DROP_END);
    } else if ((stricmp(cmd, "DROPEMAIL") == 0
		|| stricmp(cmd, "DROPEMAIL-CONFIRM") == 0)
	       && NSEnableDropEmail
	       && is_oper(u)
    ) {
	notice_help(s_NickServ, u, NICK_OPER_HELP_DROPEMAIL,
		    maketime(u->ngi,NSDropEmailExpire,0));
    } else if (stricmp(cmd, "SET") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_SET);
	if (find_module("nickserv/link"))
	    notice_help(s_NickServ, u, NICK_HELP_SET_OPTION_MAINNICK);
	notice_help(s_NickServ, u, NICK_HELP_SET_END);
	if (is_oper(u))
	    notice_help(s_NickServ, u, NICK_OPER_HELP_SET);
    } else if (strnicmp(cmd, "SET", 3) == 0
	       && isspace(cmd[3])
	       && stricmp(cmd+4+strspn(cmd+4," \t"), "LANGUAGE") == 0) {
	int i;
	notice_help(s_NickServ, u, NICK_HELP_SET_LANGUAGE);
	for (i = 0; i < NUM_LANGS && langlist[i] >= 0; i++) {
	    notice(s_NickServ, u->nick, "    %2d) %s",
		   i+1, getstring_lang(langlist[i],LANG_NAME));
	}
    } else if (stricmp(cmd, "INFO") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_INFO);
	if (find_module("nickserv/mail-auth"))
	    notice_help(s_NickServ, u, NICK_HELP_INFO_AUTH);
	if (is_oper(u))
	    notice_help(s_NickServ, u, NICK_OPER_HELP_INFO);
    } else if (stricmp(cmd, "LIST") == 0) {
	if (is_oper(u))
	    notice_help(s_NickServ, u, NICK_OPER_HELP_LIST);
	else
	    notice_help(s_NickServ, u, NICK_HELP_LIST);
	if (NSListOpersOnly)
	    notice_help(s_NickServ, u, NICK_HELP_LIST_OPERSONLY);
    } else if (stricmp(cmd, "RECOVER") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_RECOVER,
		    maketime(u->ngi,NSReleaseTimeout,MT_SECONDS));
    } else if (stricmp(cmd, "NOOP") == 0) {
        send_cmd(s_NickServ, "NOTICE %s :\2Kullanımı : SET NOOP ON/OFF\2", u->nick);
        send_cmd(s_NickServ, "NOTICE %s :-",u->nick);
        send_cmd(s_NickServ, "NOTICE %s :Nickiniz icin bir kanalda nickinize access eklenimini acar veya kapar.", u->nick);
    } else if (stricmp(cmd, "RELEASE") == 0) {
	notice_help(s_NickServ, u, NICK_HELP_RELEASE,
		    maketime(u->ngi,NSReleaseTimeout,MT_SECONDS));
    } else if (stricmp(cmd, "SUSPEND") == 0 && is_oper(u)) {
	notice_help(s_NickServ, u, NICK_OPER_HELP_SUSPEND, s_OperServ);
    } else {
	help_cmd(s_NickServ, u, module, cmd);
    }
}

/*************************************************************************/

/* Register a nick. */

static void do_register(User *u)
{
    NickInfo *ni;
    NickGroupInfo *ngi;
    char *pass = strtok(NULL, " ");
    char *email = strtok(NULL, " ");
    int n;
    time_t now = time(NULL);

    if (readonly) {
	notice_lang(s_NickServ, u, NICK_REGISTRATION_DISABLED);
	return;
    }

    if (now < u->lastnickreg + NSRegDelay) {
	time_t left = (u->lastnickreg + NSRegDelay) - now;
	notice_lang(s_NickServ, u, NICK_REG_PLEASE_WAIT,
		    maketime(u->ngi, left, MT_SECONDS));
send_cmd(s_NickServ, "SVSJOIN %s #operhelp", u->nick);

    } else if (time(NULL) < u->my_signon + NSInitialRegDelay) {
	time_t left = (u->my_signon + NSInitialRegDelay) - now;
	notice_lang(s_NickServ, u, NICK_REG_PLEASE_WAIT_FIRST,
		    maketime(u->ngi, left, MT_SECONDS));

send_cmd(s_NickServ, "PRIVMSG #operlog \2%s (%s@%s)  %s\2 Kullanicisi nickini kayitlamak istemesi nedeniyle, \2#operhelp\2 Kanalina alinmistir.", u->nick, u->username,  u->host, email);
send_cmd(s_NickServ, "SVSJOIN %s #operhelp", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2NickReg\2 Kanalina alindiniz. ", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s Kayit asamasinda bir problem yasarsaniz, bu kanalda dile getirebilirsiniz.", u->nick);
    } else if (!pass || (NSRequireEmail && !email)
	       || (stricmp(pass, u->nick) == 0
		   && (strtok(NULL, "")
		       || (email && (!strchr(email,'@')
				     || !strchr(email,'.')))))
    ) {
	/* No password/email, or they (apparently) tried to include the nick
	 * in the command. */
	syntax_error(s_NickServ, u, "REGISTER", NICK_REGISTER_SYNTAX);

    } else if (!reglink_check(u, u->nick, pass, email)) {
	/* Denied by the callback. */
	notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
	return;

    } else if (u->ni) {  /* i.e. there's already such a nick regged */
	if (u->ni->status & NS_VERBOTEN) {
	    module_log("%s@%s tried to register forbidden nick %s",
		       u->username, u->host, u->nick);
	    notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
	} else {
	    if (u->ngi->suspendinfo)
		module_log("%s@%s tried to register suspended nick %s",
			   u->username, u->host, u->nick);
	    notice_lang(s_NickServ, u, NICK_X_ALREADY_REGISTERED, u->nick);
	}

    } else if (u->ngi == NICKGROUPINFO_INVALID) {
	module_log("%s@%s tried to register nick %s with missing nick group",
		   u->username, u->host, u->nick);
	notice_lang(s_NickServ, u, NICK_REGISTRATION_FAILED);

    } else if (stricmp(pass, u->nick) == 0
	       || (StrictPasswords && strlen(pass) < 3)
    ) {
	notice_lang(s_NickServ, u, MORE_OBSCURE_PASSWORD);

    } else if (email && !valid_email(email)) {
	/* Display the syntax as well in case the user just got E-mail and
	 * password backwards.  Don't use syntax_error(), because that also
	 * prints a "for more help" message which might just confuse the
	 * user more. */
	char buf[BUFSIZE];
	snprintf(buf, sizeof(buf), getstring(u->ngi,NICK_REGISTER_SYNTAX),
		 "REGISTER");
	notice_lang(s_NickServ, u, SYNTAX_ERROR, buf);
	notice_lang(s_NickServ, u, BAD_EMAIL);

    } else if (NSRegEmailMax && email && !is_services_admin(u)
	       && ((n = count_nicks_with_email(email)) < 0
		   || n >= NSRegEmailMax)) {
	if (n < 0) {
	    notice_lang(s_NickServ, u, NICK_REGISTER_EMAIL_UNAUTHED);
	} else {
	    notice_lang(s_NickServ, u, NICK_REGISTER_TOO_MANY_NICKS, n,
			NSRegEmailMax);
	}

    } else {
	int replied = 0;
	int len = strlen(pass), max;
	char passbuf[PASSMAX];

	/* Make sure the password will fit in a PASSMAX-size buffer */
	max = encrypt_check_len(len, PASSMAX);
	/* Require the original password (including trailing NULL) to fit
	 * in a PASSMAX-size buffer as well */
	if ((max == 0 && len > PASSMAX-1) || max > PASSMAX-1)
	    max = PASSMAX-1;
	/* Truncate password if too long */
	if (max > 0) {
	    memset(pass+max, 0, len-max);
	    len = max;
	    notice_lang(s_NickServ, u, PASSWORD_TRUNCATED, max);
	}
	/* Encrypt password */
	if (encrypt(pass, len, passbuf, PASSMAX) < 0) {
	    memset(pass, 0, len);
	    module_log("Failed to encrypt password for %s (register)",
		       u->nick);
	    notice_lang(s_NickServ, u, NICK_REGISTRATION_FAILED);
	    return;
	}
	/* Do nick setup stuff */
	ni = makenick(u->nick, &ngi);
	if (!ni) {
	    module_log("makenick(%s) failed", u->nick);
	    notice_lang(s_NickServ, u, NICK_REGISTRATION_FAILED);
	    return;
	}
	memcpy(ngi->pass, passbuf, PASSMAX);
	memset(passbuf, 0, PASSMAX);
	ni->time_registered = ni->last_seen = time(NULL);
	ni->authstat = NA_IDENTIFIED | NA_RECOGNIZED;
	if (email)
	    ngi->email = sstrdup(email);
	ngi->flags = NSDefFlags;
	ngi->memos.memomax = MEMOMAX_DEFAULT;
	ngi->channelmax = CHANMAX_DEFAULT;
	ngi->language = LANG_DEFAULT;
	ngi->timezone = TIMEZONE_DEFAULT;
	call_callback_4(module, cb_registered, u, ni, ngi, &replied);
	/* If the IDENTIFIED flag is still set (a module might have
	 * cleared it, e.g. mail-auth), record the ID stamp */
	if (nick_identified(ni))
	    ni->id_stamp = u->servicestamp;
	/* Link back and forth to user record and store modified data */
	u->ni = ni;
	u->ngi = ngi;
	ni->user = u;
	update_userinfo(u);
	put_nickinfo(ni);
	put_nickgroupinfo(ngi);
	/* Tell people about it */
	if (email) {
	    module_log("%s registered by %s@%s (%s)",
		       u->nick, u->username, u->host, email);
	} else {
	    module_log("%s registered by %s@%s",
		       u->nick, u->username, u->host);
	}
	if (!replied)
	    notice_lang(s_NickServ, u, NICK_REGISTERED, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s :1Nick'iniz Sistemimize Basari ile Kaydedilmistir. \2%s\2, kullanici sozlesmesi icin  Lutfen 12/Rules1 yazip okuyunuz.", u->nick, u->nick);

send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 - \2(%s@%s) %s \2 Kullanicisi nickini kayitladi.", u->nick, u->username,  u->host, email);
send_cmd(s_NickServ, "SVSpart %s #operhelp", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2NickReg\2 Kanalindan cikarildiniz. ", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s Lutfen, \2/Kurallar\2 Yazarak kurallari okuyunuz.", u->nick);
	if (NSShowPassword)
	    notice_lang(s_NickServ, u, NICK_PASSWORD_IS, pass);
	/* Clear password from memory and other last-minute things */
	memset(pass, 0, len);
	/* Note time REGISTER command was used */
	u->lastnickreg = time(NULL);
	/* Set +r (or other registered-nick mode) if IDENTIFIED is still
	 * set. */
	if (nick_identified(ni) && usermode_reg) {
	    send_cmd(s_NickServ, "SVSMODE %s :+%s", u->nick,
		     mode_flags_to_string(usermode_reg, MODE_USER));
	}

    }

}

/*************************************************************************/

static void do_identify(User *u)
{
    char *pass = strtok_remaining();
   // char *sptr;
    NickInfo *ni = NULL;
    NickGroupInfo *ngi = NULL;
  

/* Seviyex 1 saniye , SeviyeXX 15 Gün , SeviyeXXX 60 Gün, SEVİYEXXXX 120 Gün  Saniye Olarak ayarlidir. */

ChannelInfo *ci;

    if (!pass) {
	syntax_error(s_NickServ, u, "IDENTIFY", NICK_IDENTIFY_SYNTAX);

    } else if (!(ni = u->ni)) {
	notice_lang(s_NickServ, u, NICK_NOT_REGISTERED);

    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, u->nick);

    } else if (!(ngi = u->ngi) || ngi == NICKGROUPINFO_INVALID) {
	module_log("IDENTIFY: missing NickGroupInfo for %s", u->nick);
	notice_lang(s_NickServ, u, NICK_NOT_REGISTERED);

    } else if (ngi->suspendinfo) {
	notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nick);

    } else if (!nick_check_password(u, u->ni, pass, "IDENTIFY",
				    NICK_IDENTIFY_FAILED)) {
	/* nothing */

    } else if (NSRequireEmail && !ngi->email) {
	ni->authstat |= NA_IDENT_NOMAIL;
	notice_lang(s_NickServ, u, NICK_IDENTIFY_EMAIL_MISSING, s_NickServ);

    } else if (call_callback_2(module, cb_id_check, u, pass) <= 0) {
	int old_authstat = ni->authstat;
	set_identified(u, ni, ngi);
	module_log("%s!%s@%s identified for nick %s",
		   u->nick, u->username, u->host, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :[ NS-IDENTIFY ] %s Rumuzu, %s@%s Bilgileri ile sisteme login oldu.", u->nick, u->username, u->host);
	notice_lang(s_NickServ, u, NICK_IDENTIFY_SUCCEEDED);
strscpy(last_identify_nick, u->nick, NICKMAX);

if((ngi->vhost!=NULL)) {
 send_cmd(s_NickServ, "chghost %s %s.%s.ChatAskim.Net", u->nick, ngi->vhost, u->nick);
send_cmd(s_NickServ, "NOTICE %s :1Daha onceden secmis oldugunuz 4 %s 1 Vhostu basari ile verilmistir.", u->nick, ngi->vhost);
}

if ((ngi->durum!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick,  ngi->durum);
}



/****************** toXic ******************/

// Whois : By Sky-Dancer...
 static int tox = 1;
    static int toxx =  60*60*24*5;
    static int toxxx =  60*60*24*20;
    static int toxxxx =  60*60*24*50;
static int toxxxxx =  60*60*24*100;
static int toxxxxxx =  60*60*24*200;
static int toxxxxxxx =  60*60*24*500;
static int iboss =  60*60*24*1000;


if ((!is_services_admin(u)) && (!is_services_oper(u))) 
{
  if (ni->toplamzaman  >= toxxxxxxx && ni->time_registered  >= iboss) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (KraL)  Puani -> (%d)  Aktiflik Puanı -> (%d)", u->nick, (ni->toplamzaman / 86400 * 8), (ni->toplamzaman / 86400 * 3));
}

 else  if (ni->toplamzaman  >= toxxxxxx) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Lord)  Puani -> (%d)  Aktiflik Puanı -> (%d)", u->nick, (ni->toplamzaman / 86400 * 7), (ni->toplamzaman / 86400 * 3));
}

  else if (ni->toplamzaman  >= toxxxxx) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Vezir)  Puani -> (%d)  Aktiflik Puanı -> (%d)", u->nick, (ni->toplamzaman / 86400 * 6), (ni->toplamzaman / 86400 * 3));
}

else  if (ni->toplamzaman  >= toxxxx) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Usta)  Puani -> (%d)  Aktiflik Puanı -> (%d)", u->nick, (ni->toplamzaman / 86400 * 5), (ni->toplamzaman / 86400 * 3));
}
  else if (ni->toplamzaman  >= toxxx) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Super Star)  Puani -> (%d)  Aktiflik Puanı -> (%d)", u->nick, (ni->toplamzaman / 86400 * 4), (ni->toplamzaman / 86400 * 3));
}
  else if (ni->toplamzaman  >= toxx) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Star)  Puani -> (%d)  Aktiflik Puanı -> (%d)",  u->nick, (ni->toplamzaman / 86400 * 3), (ni->toplamzaman / 86400 * 3), (ni->toplamzaman / 86400 * 3));
}
 else if (ni->toplamzaman  >= tox) {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Yeni Ceri)  Puani -> (%d)  Aktiflik Puanı -> (%d)", u->nick, (ni->toplamzaman / 86400 * 2), (ni->toplamzaman / 86400 * 3));
//send_cmd(s_NickServ, "NOTICE %s :12Aktiflik Puani = 1[ 4\2%d\2 1]",  u->nick, (ni->toplamzaman / 86400 * 3));
} else {
send_cmd(s_NickServ, "SWHOIS %s :Rutbe (Yeni Kullanici)  Puani -> (%d)  Aktiflik Puanı -> (Henuz yok.)", u->nick);
}
}




/***********************************************************************************/
if((ngi->ident!=NULL)) {
send_cmd(s_NickServ, "CHGIDENT %s %s", u->nick, ngi->ident);
}

if((ngi->takim!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :Merhaba \2 %s", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2TAKIM\2 seceneginiz \2 %s \2 olarak eklendi.", u->nick, ngi->takim);
//send_cmd(s_NickServ, "SWHOIS2 %s :Kullanicisinin TAKIMI : \2%s\2", u->nick, ngi->takim);
send_cmd(s_NickServ, "SVSJOIN %s #%s", u->nick, ngi->takim);
send_cmd(s_NickServ, "chghost %s %s.%s.ChatAskim.Net", u->nick, ngi->takim, u->nick);
}
 if((ngi->sehir!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\2SEHIR\2 seceneginiz \2 %s \2 olarak eklendi.", u->nick, ngi->sehir);
//send_cmd(s_NickServ, "SWHOIS3 %s :Kullanicisinin SEHRI : \2%s\2", u->nick, ngi->sehir);
send_cmd(s_NickServ, "SVSJOIN %s #%s", u->nick, ngi->sehir);
}
 
 if((ngi->yas!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\2YAS\2 seceneginiz \2 %s \2 olarak eklendi.", u->nick, ngi->yas);
//send_cmd(s_NickServ, "SWHOIS4 %s :Kullanicisinin YASI : \2%s\2", u->nick, ngi->yas);
 
}
 if((ngi->burc!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\2BURC\2 seceneginiz \2 %s \2 olarak eklendi.", u->nick, ngi->burc);
//send_cmd(s_NickServ, "SWHOIS5 %s :Kullanicisinin BURC'u : \2%s\2", u->nick, ngi->burc);
}
else {
send_cmd(s_NickServ, "NOTICE %s :7 /NS PROFILINFO \2 yazarak, bilgi alabilirsiniz..", u->nick);
}

 if (ngi->helper==1) {
send_cmd(s_NickServ, "NOTICE %s Merhaba \2%s\2", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2HELPER\2 Statusunde sunucuya giris yaptiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s HELPER teknik ozellikleri, sistem tarafindan size verilmistir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Bunlar disinda, \2/NS KILLS NICK SEBEP\2 komutu ile", u->nick);
send_cmd(s_NickServ, "NOTICE %s Kurallara uygunsuz davranis gosteren kullanicilari atma talebinde bulunabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2/NS HISTEK isteginiz\2 komutunu uygulayarak, \2#opers\2 kanalina bildirim yollayabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s OPERS Tarafindan cevaplanan bildirimler, #HELPERS Kanalina Services tarafindan otomatikmen gonderilecektir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Bu talepler, surekli takip altindadir ve kayitlari duzenli olarak tutulmaktadir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Iyi calismalar dileriz..", u->nick);
send_cmd(s_NickServ, "CHGHOST %s HELPER.%s.%s", u->nick, u->nick, SUNUCU);
send_cmd(s_NickServ, "SVSMODE %s +Wq :1", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s HELPER statusunde sunucuya giris yapmistir.", u->nick);
   }


send_cmd(s_NickServ, "PRIVMSG %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s IDENTINIZ : \2%s\2", u->nick, u->username);
send_cmd(s_NickServ, "PRIVMSG %s IP Adresiniz : \2%s\2", u->nick, u->host);
send_cmd(s_NickServ, "PRIVMSG %s FULLNAMENIZ : \%s\2", u->nick, u->realname);
send_cmd(s_NickServ, "PRIVMSG %s Online sureniz :  \2%d\2 Gun, \2%d\2 Saat, \2%d\2 Dakika, \2%d\2 Saniye.",
u->nick,  (ni->toplamzaman / 86400), ((ni->toplamzaman % 86400) / 3600),
  (((ni->toplamzaman % 86400) % 3600) / 60),
  ((((ni->toplamzaman % 86400) % 3600) % 60) % 60));
send_cmd(s_NickServ, "PRIVMSG %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);


srand(time(NULL));


int z = rand()%40;
send_cmd(s_NickServ, "NOTICE %s [ SOZ ] --=> \2 %s", u->nick, iborsozler[z]);
send_cmd(s_NickServ, "PRIVMSG %s [ SOZ ] --=> \2 %s", u->nick, iborsozler[z]);

int y = rand()%28;
send_cmd(s_NickServ, "NOTICE %s [ FAL ] --=> \2 %s", u->nick, ibofallar[y]);
send_cmd(s_NickServ, "PRIVMSG %s [ FAL ] --=> \2 %s", u->nick, ibofallar[y]);

int sanssayi = rand()%100;
send_cmd(s_NickServ, "NOTICE %s [ SANS ] --=> Sansli sayiniz : \2%d\2", u->nick, sanssayi);
send_cmd(s_NickServ, "PRIVMSG %s [ SANS ] --=> Sansli sayiniz : \2%d\2", u->nick, sanssayi);

int komutlar = rand()%21;
send_cmd(s_NickServ, "NOTICE %s [ BILGI ] --=>  \2%s\2", u->nick, iborand[komutlar]);
send_cmd(s_NickServ, "PRIVMSG %s [\2 BILGI\2 ] --=>  \2%s\2", u->nick, iborand[komutlar]);

int iboo = rand()%10;
send_cmd(s_NickServ, "NOTICE %s [ OYUN ] --=> Sansli oyun kanaliniz \2 %s", u->nick, oyun[iboo]);
send_cmd(s_NickServ, "PRIVMSG %s [ OYUN ] --=> Sansli oyun kanaliniz \2 %s", u->nick, oyun[iboo]);
int ibok = rand()%19;
send_cmd(s_NickServ, "NOTICE %s [ Kanal ] --=> Sansli Muhabbet kanaliniz \2 %s", u->nick, kanal[ibok]);
send_cmd(s_NickServ, "PRIVMSG %s [ Kanal ] --=> Sansli Muhabbet kanaliniz \2 %s", u->nick, kanal[ibok]);

/*************************************************************************************/

 if(!stricmp("alperss", u->nick)) {
notice_all(s_GlobalNoticer, "\2 7ChatAskim1 ISRA 4alperss1 Online durumuna gecmistir", u->nick);
send_cmd(s_GlobalNoticer, "PRIVMSG #Sohbet \2alperss\2 Suanda Online!");

}
 	call_callback_2(module, cb_identified, u, old_authstat);
    }  
}





/*****************************   Coded toXic  ********************************/
// Re-Edited By Sky-Dancer :@ 
 
static void do_sehirler(User *u)
{
 
 
NickInfo *ni = get_nickinfo(u->nick);
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nick Kaydetmeden Bu komutu Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Ayrintili Bilgi icin\2 #HELP \2 Kanalini Kullaniniz.", u->nick);
return;
}
 
send_cmd(s_NickServ, "NOTICE %s :1Kullanilabilir 4[ Sehir ]1 Listemiz", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
 
int i;
for (i=0; SehirListesi[i]!=NULL; i++ )
send_cmd(s_NickServ, "NOTICE %s :\2(%d\2) Numara -> \2%s\2", u->nick, i+1, SehirListesi[i]);
}
 
 
 
/*****************************   Coded toXic  ********************************/
 // Re-Edited By Sky-Dancer :@ 

static void do_burclar(User *u)
{
 
NickInfo *ni = get_nickinfo(u->nick);

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nick Kaydetmeden Bu komutu \2 Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Ayrintili Bilgi icin\2 #HELP \2 Kanalini Kullaniniz.", u->nick);
return;
}
 
send_cmd(s_NickServ, "NOTICE %s :1Kullanilabilir 12[ BURC ]1 Listemiz", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
 
int i;
for (i=0; BurcListesi[i]!=NULL; i++ )
send_cmd(s_NickServ, "NOTICE %s :\2(%d\2) Numara -> \2%s", u->nick,  i+1,  BurcListesi[i]);
}
 
 
/*****************************   Coded toXic  ********************************/
  // Re-Edited By Sky-Dancer :@ 
 
static void do_takimlar(User *u)
{

NickInfo *ni = get_nickinfo(u->nick);
 
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nick Kaydetmeden Bu komutu \2 Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Ayrintili Bilgi icin\2 #HELP\2 Kanalini Kullaniniz.", u->nick);
return;
}
 
send_cmd(s_NickServ, "NOTICE %s :1Kullanilabilir 12[TAKIM]1 Listemiz", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
 
int i;
for (i=0; TakimListesi[i]!=NULL; i++ )
send_cmd(s_NickServ, "NOTICE %s :\2(%d\2) Numara -> \2%s", u->nick,  i+1, TakimListesi[i]);
}
 
/*****************************   Coded toXic  ********************************/
  // Re-Edited By Sky-Dancer :@ 
 
static void do_yaslar(User *u)
{
NickInfo *ni = get_nickinfo(u->nick); 

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nick Kaydetmeden Bu komutu \2 Kullanamazsiniz..", u->nick);
return;
}
int i=0;
for (i=16; i<=75; i++)
send_cmd(s_NickServ, "NOTICE %s :\2(%d\2) Numara -> \2%d", u->nick,  i-15,  i);
}


/******************************************** Coded toXic **************************************************/

static void do_pointlist(User *u)
{
send_cmd(s_NickServ, "NOTICE %s :-\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :insanlarin digerlerinden farklilasmasi icin sürekli aktif olup birseyler yapma,", u->nick);
send_cmd(s_NickServ, "NOTICE %s :kendi ortamini kurma veya ortam yaratma cabasi icin verdigi emekler,", u->nick); 
send_cmd(s_NickServ, "NOTICE %s :Sunucuda 5 dk takilipta yetkili olanlarin degilde sunucuda sürekli takilipta, ", u->nick);
send_cmd(s_NickServ, "NOTICE %s :kendisinden bircok seyi sunucumuza veren kullanicilarimiza bu projemiz armagan olsun.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :insanlar artik herseylerinin karsiligini oyle yada boyle alacaklardir", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu projede bu sistemin bir parcasidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Assagidaki komutlari kullanabilmek icin o puanlara sahip olmaniz gerekecektir..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu Puanlamalar, \2Suanlik\2 Nick kayit tarihini, Son gorulen zamani ve Nick Online suresini baz almaktadir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Her seviye atlamanizda, puaniniz +1 olarak daha yuksek bir sayiyla carpilip hesaplanacaktir..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Ne kadar cok puanininz olursa, o kadar cok yetkili olabileceksiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :ileriye yonelik olarak puanlarinizin size bircok artisi olacaktir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Yenilik olarak bircok komutun kullanimi \2puanlar\2 uzerinden olacaktir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu nedenle puanlarinizi yukseltmeniz onemle bildirilir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Puanlarinizi yukseltmek icin \2Online\2 Olun, Sunucuya \2 3 \2 Gunde bir gelirseniz puaniniz duser.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Surekli online olursaniz puaniniz yukselir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Extra olarak, Nick kayit tarihinin uzerinden gecen zamanla +ext puan kazanacaksiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Eger Komutlari kullanamiyorsaniz sistem size kac puaniniz oldugunu soyleyecektir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Assagidaki komutlari kullanabilmek icin; ",u->nick);
send_cmd(s_NickServ, "NOTICE %s :Puanlarinizi \2WHOISLERINIZDE\2 gorebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bunlar disinda ise;", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Kendi puaninizi gormek icin \2/NS Points\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Baskasinin puaninini gormek icin \2/NS Points Nick\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Komutlarini Kullanabilirsiniz..", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Bu komutlar suanda sadece Operlerin erisimindedir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Nick INFOLARINIZDAKi aktiflik puani ise, rmal puanlarinizdan farklidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NS Sans\2 Komutu icin = \2 21\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NS Drop\2 Komutu icin = \2 6\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NS Listchans\2 Komutu icin = \2 3\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2 NS Set URL\2 Komutu icin = \2 12\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NS Set EMAIL\2 Komutu icin =\2 12\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NS Set \2INFO Komutu icin = \2 3\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2CS Drop\2 Komutu icin =\2 6 \2Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2CS Kick\2 Komutu icin = \2 15\2  Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2CS Clear\2 Komutu icin = \2 18\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2CS SET Desc\2 Komutu icin = \2 12\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2CS SET Url\2 Komutu icin = \2 12\2 Puan", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Puanlarina sahip olmalisiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Puanlama Projesi. (mPoint)", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Detayli bilgi icin -> \2 http://www.ChatAskim.Net", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-\2", u->nick);
}

/******************************************** Coded toXic **************************************************/
 
static void do_profilinfo(User *u)
{
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Merhaba, (4%s1 )", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212PROFIL Kisaca kendinizi TANITIM amaclidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/NS PROFIL %s12 komutu uygulayan arkadaslariniz 4PROFILINIZI12 gorebilir.", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Onlara kendinizi  4Bu sekilde12 Kisaca anlatabilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24 /Ns set yas yas 12 Komutu ile yasinizi Belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Sadece Rakam Kullanabilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Rakamlari 4 /Services Yaslar12 Komutu ile listeleyebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24 /Ns Set burc burc12 Komutu ile burcunuzu belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Burclari 4Services Burclar12 Komutu ile listeleyebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/Ns set sehir sehir12 Komutu ile Sehrinizi belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Sehirleri, 4 /Services sehirler12 Komutu ile listelebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/NS Set takim takim12 Komutu ile, Takiminizi belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Takimlari'da, 4/Services Takimlar12 Komutu ile listeleyebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/NS Set vhost sectiginvhost12 Komutu ile, Vhostunuzu belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Vhostlari'da, 4/Services Vhostlist 12 Komutu ile listeleyebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Yukardaki bilgileri sadece listede olanlardan secebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Bunun disinda secim yapamazsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Eger eklenmesini istediginiz olursa, 5/Services Oneri Oneriniz12 komutu ile onerinizi belirtebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/NS Durum Durumunuz12 Komutu ile, o anlik durumunuzu belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/NS TWEET Tweetiniz12 Komutu ile, tweet atabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Tweet ve Durumunuzu renkli olarak veya arada bosluk birakarakta yazabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24/NS isim isminiz12 Komutu ile, isminizi belirtebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :--", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Bu Komutlari, Nicki kayitli olan herkes kullanabilir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Girilen bilgileri kaldirmak icin, 4/NS UNSET12 Komutunu kullanmak yeterlidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Ornek; 4/NS UNSET Sehir12 gibi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24TWEET12 ve 4DURUM12 bilginizi surekli guncelleyebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Fakat bunda 4Reklam/Kufur12 vb. gecirmeniz halinde  durumlarda nickiniz yasaklanabilir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2", u->nick);
}


/*************************************************************************/

static void do_istek(User *u)
{
char *reason = strtok_remaining();
NickInfo *ni = get_nickinfo(u->nick);

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}


 if (!reason) {
send_cmd(s_NickServ, "NOTICE %s :Isteginizi girmediniz.", u->nick);
return;
}

int toxgun=1;
int tox = 60*60*24*toxgun;

    if (!is_services_admin(u) && ni->toplamzaman <= tox) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NEDEN\2 -> Nick Online puaniniz,  \2 ( 2 ) \2 Olmalidir.", u->nick);
return;
}
else {

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("istek.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  -> %s\n", asctime (timeinfo), u->nick, reason);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}

send_cmd(s_NickServ, "NOTICE %s :Isteginiz alinmistir.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :%s Kullanici bir istekte bulundu.", u->nick);
  }
}


/*************************************************************************/

static void do_oneri(User *u)
{
char *reason = strtok_remaining();
NickInfo *ni = get_nickinfo(u->nick);


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}

 if (!reason) {
send_cmd(s_NickServ, "NOTICE %s :Onerinizi girmediniz.", u->nick);
return;
}

int toxgun=1;
int tox = 60*60*24*toxgun;

if (!is_services_admin(u) && ni->toplamzaman <= tox) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NEDEN\2 -> Nick Online puaniniz,  \2 ( 2 ) \2 Olmalidir.", u->nick);
return;
}
else {

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("oneri.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  -> %s\n", asctime (timeinfo), u->nick, reason);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}

send_cmd(s_NickServ, "NOTICE %s :Oneriniz alinmistir.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :%s Kullanici bir oneride bulundu.", u->nick);

  }
}

/*************************************************************************/
static void do_sikayet(User *u)
{
char *reason = strtok_remaining();
NickInfo *ni = get_nickinfo(u->nick);


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}
 if (!reason) {
send_cmd(s_NickServ, "NOTICE %s :Sikayetinizi girmediniz.", u->nick);
return;
}

int toxgun=1;
int tox = 60*60*24*toxgun;
if (!is_services_admin(u) && ni->toplamzaman <= tox) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2NEDEN\2 -> Nick Online puaniniz,  \2 ( 2 ) \2 Olmalidir.", u->nick);
return;
}
else {
time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("sikayet.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  -> %s\n", asctime (timeinfo), u->nick, reason);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}

send_cmd(s_NickServ, "NOTICE %s :Sikayetiniz alinmistir.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :%s Kullanici bir sikayette bulundu.", u->nick);

  }
}

/*************************************************************************/

static void do_sikayetler(User *u)
{
/*
NickInfo *ni = get_nickinfo(u->nick);
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}*/
if (!is_services_admin(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}
char *ibokus = "sikayet.txt";


char buf[BUFSIZE];
FILE *x = fopen(ibokus, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}

/*************************************************************************/

static void do_istekler(User *u)
{/*
NickInfo *ni = get_nickinfo(u->nick);
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}*/
if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokui = "istek.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokui, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}

/*************************************************************************/

static void do_oneriler(User *u)
{/*
NickInfo *ni = get_nickinfo(u->nick);
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}*/

if (!is_services_admin(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokuo = "oneri.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokuo, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}


/*************************************************************************/

static void do_ozellikler(User *u)
{

if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokuoz="ozellikler.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokuoz, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "PRIVMSG #Opers :%s",  buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok..", u->nick);
}
}



/*************************************************************************/

static void do_nickinfo(User *u)
{
if (!is_services_admin(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokuc = "nickservibo.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokuc, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}


/*************************************************************************/

static void do_operules(User *u)
{
if (!is_services_oper(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokuttx = "operules.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokuttx, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}


/*************************************************************************/


static void do_opersrules(User *u)
{/*
NickInfo *ni = get_nickinfo(u->nick);
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}*/

if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokuozt="operules.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokuozt, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "PRIVMSG #Opers :%s",  buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok..", u->nick);
}
}




/*************************************************************************/

static void do_drop(User *u)
{
    char *pass = strtok(NULL, " ");
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi = (u->ngi==NICKGROUPINFO_INVALID ? NULL : u->ngi);

    if (readonly && !is_services_admin(u)) {
	notice_lang(s_NickServ, u, NICK_DROP_DISABLED);
	return;
    }


    if (!pass || strtok_remaining()) {
	syntax_error(s_NickServ, u, "DROP", NICK_DROP_SYNTAX);
	if (find_module("nickserv/link") || find_module("nickserv/oldlink"))
	    notice_lang(s_NickServ, u, NICK_DROP_WARNING);
    } else if (!ni || !ngi) {
	notice_lang(s_NickServ, u, NICK_NOT_REGISTERED);
    } else if (ngi->suspendinfo) {
	notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nick);
    } else if (!nick_check_password(u, u->ni, pass, "DROP",
				    NICK_DROP_FAILED)) {
	/* nothing */
    } else {
	if (readonly)  /* they must be a servadmin in this case */
	    notice_lang(s_NickServ, u, READ_ONLY_MODE);
	drop_nickgroup(ngi, u, NULL);
	notice_lang(s_NickServ, u, NICK_DROPPED);


strscpy(last_drop_nick, u->nick, NICKMAX);  
  }
}

/*************************************************************************/

/* Services admin function to drop another user's nickname.  Privileges
 * assumed to be pre-checked.
 */

static void do_dropnick(User *u)
{
    char *nick = strtok(NULL, " ");
    NickInfo *ni;
    NickGroupInfo *ngi;

#ifdef CLEAN_COMPILE
    ngi = NULL;
#endif

    if (!nick) {
	syntax_error(s_NickServ, u, "DROPNICK", NICK_DROPNICK_SYNTAX);
    } else if (!(ni = get_nickinfo(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->nickgroup && !(ngi = get_ngi(ni))) {
	notice_lang(s_NickServ, u, INTERNAL_ERROR);
    } else if (NSSecureAdmins && nick_is_services_admin(ni) &&
    						!is_services_root(u)) {
	notice_lang(s_NickServ, u, PERMISSION_DENIED);
    } else {
	if (readonly)
	    notice_lang(s_NickServ, u, READ_ONLY_MODE);
	if (ni->nickgroup) {
	    drop_nickgroup(ngi, u, PTR_INVALID);
	} else {
	    module_log("%s!%s@%s dropped forbidden nick %s",
		       u->nick, u->username, u->host, ni->nick);
	    delnick(ni);
	}
if (stricmp(ni->nick, ServicesRoot) == 0) {
send_cmd(s_NickServ, "NOTICE %s Services ROOT Nickine DROPNICK komutu uygulayamazsiniz.", u->nick);
return;
}

	notice_lang(s_NickServ, u, NICK_X_DROPPED, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :DROP-NICK: * 4%s2 * rumuzu droplandı, komutu uygulayan yetkili: * 4%s2 *", nick, u->nick);

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("nickservibo.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  DROPNICK -> %s \n", asctime (timeinfo),  u->nick, nick);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}


 }
}

/*************************************************************************/

/* Services admin function to drop all nicknames whose E-mail address
 * matches the given mask.  Privileges assumed to be pre-checked.
 */

/* List of recent DROPEMAILs for CONFIRM */
static struct {
    char sender[NICKMAX];	/* Who sent the command (empty = no entry) */
    char mask[BUFSIZE];		/* What mask was used */
    int count;
    time_t sent;		/* When the command was sent */
} dropemail_buffer[DROPEMAIL_BUFSIZE];

static void do_dropemail(User *u)
{
    char *mask = strtok(NULL, " ");
    NickGroupInfo *ngi;
    int count, i, found;

    /* Parameter check */
    if (!mask || strtok_remaining()) {
	syntax_error(s_NickServ, u, "DROPEMAIL", NICK_DROPEMAIL_SYNTAX);
	return;
    }
    if (strlen(mask) > sizeof(dropemail_buffer[0].mask)-1) {
	notice_lang(s_NickServ, u, NICK_DROPEMAIL_PATTERN_TOO_LONG,
		    sizeof(dropemail_buffer[0].mask)-1);
	return;
    }

    /* Count nicks matching this mask; exit if none found */
    if (strcmp(mask,"-") == 0)
	mask = NULL;
    count = 0;
    for (ngi = first_nickgroupinfo(); ngi; ngi = next_nickgroupinfo()) {
	if ((mask && ngi->email && match_wild_nocase(mask,ngi->email))
	 || (!mask && !ngi->email)
	) {
	    count += ngi->nicks_count;
	}
    }
    if (!count) {
	notice_lang(s_NickServ, u, NICK_DROPEMAIL_NONE);
	return;
    }
    if (mask == NULL)
	mask = "-";

    /* Clear out any previous entries for this sender/mask */
    for (i = 0; i < DROPEMAIL_BUFSIZE; i++) {
	if (irc_stricmp(u->nick, dropemail_buffer[i].sender) == 0
	 && stricmp(mask, dropemail_buffer[i].mask) == 0
	) {
	    memset(&dropemail_buffer[i], 0, sizeof(dropemail_buffer[i]));
	}
    }

    /* Register command in buffer */
    found = -1;
    for (i = 0; i < DROPEMAIL_BUFSIZE; i++) {
	if (!*dropemail_buffer[i].sender) {
	    found = i;
	    break;
	}
    }
    if (found < 0) {
	found = 0;
	for (i = 1; i < DROPEMAIL_BUFSIZE; i++) {
	    if (dropemail_buffer[i].sent < dropemail_buffer[found].sent)
		found = i;
	}
    }
    memset(&dropemail_buffer[found], 0, sizeof(dropemail_buffer[found]));
    strscpy(dropemail_buffer[found].sender, u->nick,
	    sizeof(dropemail_buffer[found].sender));
    strscpy(dropemail_buffer[found].mask, mask,
	    sizeof(dropemail_buffer[found].mask));
    dropemail_buffer[found].sent = time(NULL);
    dropemail_buffer[found].count = count;

    /* Send count and prompt for confirmation */
    notice_lang(s_NickServ, u, NICK_DROPEMAIL_COUNT, count, s_NickServ, mask);
}


static void do_dropemail_confirm(User *u)
{
    char *mask = strtok(NULL, " ");
    NickGroupInfo *ngi;
    int i;

    /* Parameter check */
    if (!mask || strtok_remaining()) {
	syntax_error(s_NickServ, u, "DROPEMAIL-CONFIRM",
		     NICK_DROPEMAIL_CONFIRM_SYNTAX);
	return;
    }

    /* Make sure this is a DROPEMAIL that (1) we've seen and (2) hasn't
     * expired */
    for (i = 0; i < DROPEMAIL_BUFSIZE; i++) {
	if (irc_stricmp(u->nick, dropemail_buffer[i].sender) == 0
	 && stricmp(mask, dropemail_buffer[i].mask) == 0
	 && time(NULL) - dropemail_buffer[i].sent < NSDropEmailExpire
	) {
	    break;
	}
    }
    if (i >= DROPEMAIL_BUFSIZE) {
	notice_lang(s_NickServ, u, NICK_DROPEMAIL_CONFIRM_UNKNOWN);
	return;
    }

    /* Okay, go ahead and delete */
    notice_lang(s_NickServ, u, NICK_DROPEMAIL_CONFIRM_DROPPING,
		dropemail_buffer[i].count);
    if (readonly)
	notice_lang(s_NickServ, u, READ_ONLY_MODE);
    if (strcmp(mask,"-") == 0)
	mask = NULL;
    for (ngi = first_nickgroupinfo(); ngi; ngi = next_nickgroupinfo()) {
	if ((mask && ngi->email && match_wild_nocase(mask,ngi->email))
	 || (!mask && !ngi->email)
	) {
	    drop_nickgroup(ngi, u, mask ? mask : "-");
	}
    }
    notice_lang(s_NickServ, u, NICK_DROPEMAIL_CONFIRM_DROPPED);
}

/*************************************************************************/

/* Show hidden info to nick owners and sadmins when the "ALL" parameter is
 * supplied. If a nick is online, the "Last seen address" changes to "Is
 * online from".
 * Syntax: INFO <nick> {ALL}
 * -TheShadow (13 Mar 1999)
 */

/* Check the status of show_all and make a note of having done so.  This is
 * used at the end, to see whether we should print a "use ALL for more info"
 * message.  Note that this should be the last test in a boolean expression,
 * to ensure that used_all isn't set inappropriately. */
#define CHECK_SHOW_ALL (used_all++, show_all)

static void do_info(User *u)
{
    char *nick = strtok(NULL, " ");
    char *param = strtok(NULL, " ");
    NickInfo *ni;
    NickGroupInfo *ngi;

char *ibosozler[40]={
"Deniz ne kadar dalgali olsa sonunda durulur. (GOETHE)",
"Ihanetin kucugu buyugu olmaz. (HZ.ISA)",
"Tarih,hukumdarlarin en iyi danismanidir. (T. CARLYL)",
"Mezarliklar toplum icin gerekli insanlarla doludur. (Charles de Gaulle)",
"Iyilik hicbir zaman cezasiz kalmaz. (Gore Vidal)",
"Ihtiyac, icatlarin anasidir. (WILLIAM WYCERLEY)",
"Gomlegin ilk dugmesi yanlis iliklenince digerleri de yanlis gider. (C.BRUNO)",
"Hayat yasanti aramak degil kendimizi aramaktir. (C.PAVESE)",
"Bu dahil butun genellemeler yanlistir. (F.NIETZSCHE)",
"Insan, ucurumun kenarina varmadan kanatlanmaz. (KAZANCAKIS)",
"Vicdani tertemizdi cunku onu hic kullanmamisti. (S.LEC)",
"Insan ancak anladigi seyler duyar. (GOETHE)",
"Kaptanin ustaligi deniz durgunken anlasilmaz. (LUKIANOS)",
"Iyi dostu olanin aynaya gereksinimi yoktur. (Mevlana)", 
"Ruyalari gerceklestirmenin en iyi yolu uyanmaktir. (S. M. Power)", 
"Acinmaktansa, Kiskanilmak daha iyidir. (HERODOT)",
"Herseyi denerim; ama yapabildiklerimi yaparim.. (Herman Melville)", 
"Askin gizemi, olumun gizeminden daha buyuktur. (Oscar Wilde)",
"Adalet olmadan duzen olmaz. (Albert CAMUS)"
"Adaleti, aklin yardimi olmadan kullanmak imkansizdir. (FREUDE)",
"Adalet, once devletten gelir. (ARISTO)",
"TANRININ degirmeni agir ama iyi ogutur. (GEORGE HERBERT)",
"Genclikte, guzellikte akil arama. (HOMEROS)",
"Aklinda gor, Kalbinle isit. (Turk Atasozu)",
"Ancak, kendi kendini idare edebilen akilli insanlar hurdur. (HORACE)",
"Arkadas, sizin hoslanmadiginiz kimselerden hoslanmayan insandir. (ANONIM)",
"Ana-babalarimiz tesadufle, arkadaslarimiz secimle kazanilir. (DELILLE)",
"Arkadas edinmenin tek yolu, arkadas olmaktir. (EMERSON)",
"Arkadaslik yapilmaz, dogar. (H. B. ADAMS)",
"Akilsiz basin cezasini ayaklar ceker. (TURK Atasozu)",
"Herseyin baslangici kucuktur. (CICERO)",
"Iyi bitirmek, iyi baslamaktan daha ustundur. (OVIDIUS)",
"Baslangici olan birsey nasil olsa biter. (OUINTILIAN)",
"Aptallar, eski olaylari hatirlamayi, bir bilim sayarlar. (PLANCHE)",
"Borc, en kotu yoksulluktur. (M. G. LICHTWER)",
"Borc, dipsiz bir denizdir. (CARLYLE)",
"Borc yiyen, kesesinden yer. (TURK Atasozu)",
"Cesaretle dolu bir insan, inancla dolu olan insandir. (CICERO)",
"Cesaret, butun silahlardan ustundur. (OVIDIUS)",
"Ormanda en cok sesi maymunlar cikarsada, kral her zaman aslandir. (toXic)",
};

/*  
  static int SEVIYEI = 1; 
    static int SEVIYEII =  60*60*24*15;
    static int SEVIYEIII =  60*60*24*60;
    static int SEVIYEIIII =  60*60*24*120;
*/
/* Seviyex 1 saniye , SeviyeXX 15 Gün , SeviyeXXX 60 G, SEVİYEXXXX 120 Gün  Saniye Olarak ayarlidir. */

    if (!nick) {
    	syntax_error(s_NickServ, u, "INFO", NICK_INFO_SYNTAX);

    } else if (!(ni = get_nickinfo(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);

    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);

    } else {
	char buf[BUFSIZE], *end;
	const char *commastr = getstring(u->ngi, COMMA_SPACE);
	int need_comma = 0;
	int nick_online = 0;
	int can_show_all = 0, show_all = 0, used_all = 0;

	ngi = get_ngi(ni);
	if (!ngi) {
	    notice_lang(s_NickServ, u, INTERNAL_ERROR);
	    return;
	}
           if ( (ngi->flags & NF_PRIVATE) )
          {
 if
                 (!is_oper(u))
if  (!nick_identified(ni) || (u->ngi != ngi))
                 
                    {
                        send_cmd(s_NickServ, "NOTICE %s :4%s12 Kullanicisi, 4NICK INFO12'sunu kapatmistir.", u->nick, ni->nick);
                        return;
                    }
          }



  

	/* Is the real owner of the nick we're looking up online? -TheShadow */
	if (ni->user && nick_id_or_rec(ni))
	    nick_online = 1;

        /* Only show hidden fields to owner and sadmins and only when the ALL
	 * parameter is used. -TheShadow */
	can_show_all = ((u==ni->user && nick_online) || is_services_admin(u));

	if (can_show_all && (param && stricmp(param, "ALL") == 0))
	    show_all = 1;
        if (nick_is_services_oper(ni))
send_cmd(s_NickServ, "NOTICE %s :%s nicki size \2[/NickServ INFO]\2 komutunu uyguladi.",  ni->nick, u->nick);

send_cmd(s_NickServ, "NOTICE %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);

	notice_lang(s_NickServ, u, NICK_INFO_REALNAME,
		    nick, ni->last_realname);
    if(nick_is_services_oper(ni)) {
          if (stricmp(ni->nick, ServicesRoot) == 0)
            send_cmd(s_NickServ, "NOTICE %s :%s Services Root Administrator (SRA)",
            u->nick, ni->nick);
      else  if(!stricmp("toXic", nick)) {
             send_cmd(s_NickServ, "NOTICE %s :\2%s Services Root Administrator 4(SRA)",
             u->nick, ni->nick);
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2 RuLZzServices DevelOper",
             u->nick, ni->nick);
             send_cmd(s_NickServ, "NOTICE %s :\212ChatAskim.Net The projects responsible..",
             u->nick);
             

      }
      else  if(!stricmp("Txxurk", nick)) {
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2  Services Root Admin",
            u->nick, ni->nick);
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2 ChatAskim.Net  Sunucu sahibi.",
            u->nick, ni->nick);
       }
      else  if(!stricmp("alperss", nick)) {
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2  Services Root Administrator 4(SRA)",
            u->nick, ni->nick);
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2 ChatAskim.Net Services Master",
            u->nick, ni->nick);
       }
      else  if(!stricmp("Siyahlim1235x", nick)) {
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2  Services Root Administrator \2(SRA)",
            u->nick, ni->nick);
}

      else  if(!stricmp("diLaraxxx123x", nick)) {
            send_cmd(s_NickServ, "NOTICE %s :\2%s\2  Services Root Administrator \2(SRA)",
            u->nick, ni->nick);
}
   else if (nick_is_services_admin(ni)) {
           send_cmd(s_NickServ, "NOTICE %s :%s Services Administrator (SA)",
           u->nick, ni->nick);
     }
   
     else {
          send_cmd(s_NickServ, "NOTICE %s :%s Services Operator (SOP)",
          u->nick, ni->nick);
     }
  }

  if (ngi->helper==1) {
    send_cmd(s_NickServ, "NOTICE %s :\24%s12 ChatAskim IRC Network 4 HELPER", u->nick, ni->nick);
    send_cmd(s_NickServ, "NOTICE %s :\2%s\2 nicki size \2[/NickServ INFO]\2 komutunu uyguladi", ni->nick, u->nick);
  }

	/* Ignore HIDE and show the real hostmask to anyone who can use
	 * INFO ALL. */
	if (nick_online) {
	    if (!(ngi->flags & NF_HIDE_MASK) || can_show_all)
		notice_lang(s_NickServ, u, NICK_INFO_ADDRESS_ONLINE,
			can_show_all ? ni->last_realmask : ni->last_usermask);
	    else
		notice_lang(s_NickServ, u, NICK_INFO_ADDRESS_ONLINE_NOHOST,
			    ni->nick);
	} else {
	    if (!(ngi->flags & NF_HIDE_MASK) || can_show_all)
		notice_lang(s_NickServ, u, NICK_INFO_ADDRESS,
			can_show_all ? ni->last_realmask : ni->last_usermask);
            strftime_lang(buf, sizeof(buf), u->ngi,
			  STRFTIME_DATE_TIME_FORMAT, ni->last_seen);
            notice_lang(s_NickServ, u, NICK_INFO_LAST_SEEN, buf);
	}
 if (!noexpire && NSExpire && !(ni->status & NS_NOEXPIRE))
 {
        int time_left = NSExpire - (time(NULL) - ni->last_seen);
        if (time_left) {
            notice(s_NickServ, u->nick, "Bu nick tekrar kullanilana kadar \2 %s \2 gunluk koruma altindadir..",
                        maketime(get_ngi(ni),time_left,0));

        }
}
if (!stricmp(nick, "clone")) {
send_cmd(s_NickServ,"NOTICE %s :Toplam Online Süresi: \2 1000\2 Gun \2 0\2 Saat \2 0\2 Dakika ve \2 0\2 Saniye.",
u->nick);
} else {
send_cmd(s_NickServ,
"NOTICE %s :Toplam Online Süresi: \2%d\2 Gun \2%d\2 Saat \2%d\2 Dakika ve \2%d\2 Saniye.",
u->nick,  (ni->toplamzaman / 86400), ((ni->toplamzaman % 86400) / 3600),
  (((ni->toplamzaman % 86400) % 3600) / 60),
  ((((ni->toplamzaman % 86400) % 3600) % 60) % 60));
}


send_cmd(s_NickServ, "NOTICE %s :Puani = \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 3));

 
 if ((ni->status & NS_NOEXPIRE))
            send_cmd(s_NickServ, "NOTICE %s :Bu Kullanicida \2zaman asimi yoktur\2 sinirsiz korumadadir!", u->nick);


	strftime_lang(buf, sizeof(buf), u->ngi, STRFTIME_DATE_TIME_FORMAT,
		      ni->time_registered);
if (!stricmp(nick, "toXic")) {
send_cmd(s_NickServ, "NOTICE %s :      Kayit zamani: Jun 05 00:00:00 1990 PST", u->nick);
}      
 else if (!stricmp(nick, "Onurkan")) {
  send_cmd(s_NickServ, "NOTICE %s :      Kayit zamani: Jun 09 00:00:00 1905 PST", u->nick);
}
 else if (!stricmp(nick, "CLoNe")) {
  send_cmd(s_NickServ, "NOTICE %s :      Kayit zamani: 15.09.1982", u->nick);
}

 else {

	notice_lang(s_NickServ, u, NICK_INFO_TIME_REGGED, buf);
}
	if (ni->last_quit && (!(ngi->flags & NF_HIDE_QUIT) || CHECK_SHOW_ALL))
	    notice_lang(s_NickServ, u, NICK_INFO_LAST_QUIT, ni->last_quit);
	if (ngi->url)
	    notice_lang(s_NickServ, u, NICK_INFO_URL, ngi->url);
	if (ngi->email && (!(ngi->flags & NF_HIDE_EMAIL) || CHECK_SHOW_ALL)) {
	    if (ngi->authcode) {
		if (can_show_all) {
		    notice_lang(s_NickServ, u, NICK_INFO_EMAIL_UNAUTHED,
				ngi->email);
		}
	    } else {
		notice_lang(s_NickServ, u, NICK_INFO_EMAIL, ngi->email);
	    }
	}
	if (ngi->info)
	    notice_lang(s_NickServ, u, NICK_INFO_INFO, ngi->info);
	*buf = 0;
	end = buf;
	if (ngi->flags & NF_KILLPROTECT) {
	    end += snprintf(end, sizeof(buf)-(end-buf), "%s",
			    getstring(u->ngi, NICK_INFO_OPT_KILL));
	    need_comma = 1;
	}
	if (ngi->flags & NF_SECURE) {
	    end += snprintf(end, sizeof(buf)-(end-buf), "%s%s",
			    need_comma ? commastr : "",
			    getstring(u->ngi, NICK_INFO_OPT_SECURE));
	    need_comma = 1;
	}
	if (ngi->flags & NF_PRIVATE) {
	    end += snprintf(end, sizeof(buf)-(end-buf), "%s%s",
			    need_comma ? commastr : "",
			    getstring(u->ngi, NICK_INFO_OPT_PRIVATE));
	    need_comma = 1;
	}
	notice_lang(s_NickServ, u, NICK_INFO_OPTIONS,
		    *buf ? buf : getstring(u->ngi, NICK_INFO_OPT_NONE));

	if ((ni->status & NS_NOEXPIRE) && CHECK_SHOW_ALL)
	    notice_lang(s_NickServ, u, NICK_INFO_NO_EXPIRE);

	if (ngi->suspendinfo) {
	    notice_lang(s_NickServ, u, NICK_X_SUSPENDED, nick);
	    if (CHECK_SHOW_ALL) {
		SuspendInfo *si = ngi->suspendinfo;
		char timebuf[BUFSIZE], expirebuf[BUFSIZE];

		strftime_lang(timebuf, sizeof(timebuf), u->ngi,
			      STRFTIME_DATE_TIME_FORMAT, si->suspended);
		expires_in_lang(expirebuf, sizeof(expirebuf), u->ngi,
				si->expires);
		notice_lang(s_NickServ, u, NICK_INFO_SUSPEND_DETAILS,
			    si->who, timebuf, expirebuf);
		notice_lang(s_NickServ, u, NICK_INFO_SUSPEND_REASON,
			    si->reason);
	    }
	}


strscpy(last_info_nick, u->nick, NICKMAX);

if((ngi->takim!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :TAKIM : \2%s\2", u->nick, ngi->takim);
}
 if((ngi->sehir!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :SEHIR : \2%s\2", u->nick, ngi->sehir);
}

 if((ngi->yas!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :YAS : \2%s\2", u->nick, ngi->yas);

}
 if((ngi->burc!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :BURC : \2%s\2", u->nick, ngi->burc);
}

if((ngi->iliski!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  :ILISKI DURUMU : \2%s\2", u->nick, ngi->iliski);
}

if((ngi->iliskinick!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  :\2%s\2 ile iliskisi var.", u->nick, ngi->iliskinick);
}






send_cmd(s_NickServ, "NOTICE %s :Nick Problemleri icin, \2#NickServ", u->nick);
 if (ngi->noop==1) {
send_cmd(s_NickServ, "NOTICE %s \2Bu Kullaniciya Access Eklenemez.", u->nick);
} else {
send_cmd(s_NickServ, "NOTICE %s \2Bu Kullaniciya Access Eklenebilir.", u->nick);
}

int komutlar = rand()%21;
send_cmd(s_NickServ, "NOTICE %s [BILGI] --=>  \2%s\2", u->nick, iborand[komutlar]);
int s = rand()%40;
send_cmd(s_NickServ, "NOTICE %s [ SOZ ] --=>  \2%s\2", u->nick, ibosozler[s]);

send_cmd(s_NickServ, "NOTICE %s Kullanicinin profilini gormek icin, \2/NS PROFIL %s\2 Komutunu uygulayiniz.", u->nick, ni->nick);


send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
//send_cmd(s_NickServ, "PRIVMSG #operlog \2 %s\2 kullanicisi \2%s\2 Kullanicisina \2INFO\2 Komutu uyguladi.", u->nick, ni->nick);
	if (can_show_all && !show_all && used_all)
	    notice_lang(s_NickServ, u, NICK_INFO_SHOW_ALL, s_NickServ,
			ni->nick);
    }
}

/*************************************************************************/

static void do_listchans(User *u)
{
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi;
   



    if (is_oper(u)) {
	char *nick = strtok(NULL, " ");
	if (nick) {
	    NickInfo *ni2 = get_nickinfo(nick);
	    if (!ni2) {
		notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
		return;
	    } else if (ni2 == ni) {
		/* Let the command through even for non-servadmins if they
		 * gave their own nick; it's less confusing than a
		 * "Permission denied" error */
	    } else if (!is_services_admin(u)) {
		notice_lang(s_NickServ, u, PERMISSION_DENIED);
		return;
	    } else {
		ni = ni2;
	    }
	}
    } else if (strtok_remaining()) {
	syntax_error(s_NickServ, u, "LISTCHANS", NICK_LISTCHANS_SYNTAX);
	return;
    }
    if (!ni) {
	notice_lang(s_NickServ, u, NICK_NOT_REGISTERED);
	return;
    }
    if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
    } else if (!user_identified(u)) {
	notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
    } else if (!(ngi = get_ngi(ni))) {
	notice_lang(s_NickServ, u, INTERNAL_ERROR);
    } else if (!ngi->channels_count) {
	notice_lang(s_NickServ, u, NICK_LISTCHANS_NONE, ni->nick);
    } else {
	int i;
	notice_lang(s_NickServ, u, NICK_LISTCHANS_HEADER, ni->nick);
	ARRAY_FOREACH (i, ngi->channels)
	    notice(s_NickServ, u->nick, "    %s", ngi->channels[i]);
	notice_lang(s_NickServ, u, NICK_LISTCHANS_END, ngi->channels_count);
    }
}

/*************************************************************************/

static void do_list(User *u)
{
    char *pattern = strtok(NULL, " ");
    char *keyword;
    NickInfo *ni;
    NickGroupInfo *ngi;
    int nnicks;
    char buf[BUFSIZE];
    int is_servadmin = is_services_admin(u);
    int16 match_NS = 0;  /* NS_ flags a nick must match one of to qualify */
    int32 match_NF = 0;  /* NF_ flags a nick must match one of to qualify */
    int match_susp = 0;  /* 1 if we match on suspended nicks */
    int match_auth = 0;  /* 1 if we match on nicks with auth codes */
    int have_auth_module = 0;  /* so we don't show no-auth char if no module */

    if (NSListOpersOnly && !is_oper(u)) {
	notice_lang(s_NickServ, u, PERMISSION_DENIED);
	return;
    }

    have_auth_module = (find_module("nickserv/mail-auth") != NULL);

    if (!pattern) {
	syntax_error(s_NickServ, u, "LIST",
		     is_oper(u) ? NICK_LIST_OPER_SYNTAX : NICK_LIST_SYNTAX);
    } else {
	int mask_has_at = (strchr(pattern,'@') != 0);

	nnicks = 0;

	while (is_servadmin && (keyword = strtok(NULL, " "))) {
	    if (stricmp(keyword, "FORBIDDEN") == 0) {
		match_NS |= NS_VERBOTEN;
	    } else if (stricmp(keyword, "NOEXPIRE") == 0) {
		match_NS |= NS_NOEXPIRE;
	    } else if (stricmp(keyword, "SUSPENDED") == 0) {
		match_susp = 1;
	    } else if (stricmp(keyword, "NOAUTH") == 0 && have_auth_module) {
		match_auth = 1;
	    } else {
		syntax_error(s_NickServ, u, "LIST",
		     is_oper(u) ? NICK_LIST_OPER_SYNTAX : NICK_LIST_SYNTAX);
	    }
	}

	notice_lang(s_NickServ, u, NICK_LIST_HEADER, pattern);
	for (ni = first_nickinfo(); ni; ni = next_nickinfo()) {
	    int usermask_seen = 0;  /* does user get to see the usermask? */
	    const char *mask;  /* which mask to show? (fake vs. real) */

	    if (u == ni->user || is_services_admin(u))
		mask = ni->last_realmask;
	    else
		mask = ni->last_usermask;
	    ngi = get_nickgroupinfo(ni->nickgroup);
	    if (!is_servadmin && ((ngi && (ngi->flags & NF_PRIVATE))
				  || (ni->status & NS_VERBOTEN)))
		continue;
	    if (match_NS || match_NF || match_susp || match_auth)
		/* ok, we have flags, now see if they match */
		if (!((ni->status & match_NS)
		   || (ngi && (ngi->flags & match_NF))
		   || (ngi && ngi->suspendinfo && match_susp)
		   || (ngi && ngi->authcode && match_auth)
		)) {
		    continue;
		}
	    if (!is_servadmin && (ngi->flags & NF_HIDE_MASK)) {
		snprintf(buf, sizeof(buf), "%-20s  [Hidden]", ni->nick);
	    } else if (ni->status & NS_VERBOTEN) {
		snprintf(buf, sizeof(buf), "%-20s  [Forbidden]", ni->nick);
	    } else {
		usermask_seen = 1;
		snprintf(buf, sizeof(buf), "%-20s  %s", ni->nick, mask);
	    }
	    if ((!mask_has_at && match_wild_nocase(pattern, ni->nick))
	     || (mask_has_at && usermask_seen
		 && match_wild_nocase(pattern, mask))
	    ) {
		if (++nnicks <= NSListMax) {
		    char suspended_char = ' ';
		    char noexpire_char = ' ';
		    const char *auth_char = have_auth_module ? " " : "";
		    if (is_servadmin) {
			if (ngi && ngi->suspendinfo)
			    suspended_char = '*';
			if (ni->status & NS_NOEXPIRE)
			    noexpire_char = '!';
			if (have_auth_module && ngi && ngi->authcode)
			    auth_char = "?";
		    }
		    notice(s_NickServ, u->nick, "   %c%c%s %s",
			   suspended_char, noexpire_char, auth_char, buf);
		}
	    }
	}
	notice_lang(s_NickServ, u, NICK_LIST_RESULTS,
			nnicks>NSListMax ? NSListMax : nnicks, nnicks);
    }
}



/************************************************************/


static void do_check(User *u)
{
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi;




if (!is_services_oper(u)) {
send_cmd(s_NickServ, "NOTICE %s :OPERS'e kullanim yetkisi verilmistir.", u->nick);
return;
}

        char *nick = strtok(NULL, " ");
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
                /* Let the command through even for non-servadmins if they
                 * gave their own nick; it's less confusing than a
                 * "Permission denied" error */
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }


  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }
     if ( (ngi->flags & NF_PRIVATE) )
          {
                 if
                 (!is_oper(u))
if  (!nick_identified(ni) || (u->ngi != ngi))

                    {
                        send_cmd(s_NickServ, "NOTICE %s Kullanici bu bilgileri gosterime kapatmis.", u->nick);
                        return;
                    }
          }
   if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
return;
    } else if (!user_identified(u)) {
        notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
return;
    }



int t;
 if (!ngi->ajoin_count) {
            send_cmd(s_NickServ, "NOTICE %s Kullanicinin, AUTOJOIN kanali yoktur.", u->nick);
} else {
 send_cmd(s_NickServ, "NOTICE %s \2  Kullanicinin AUTOJOIN kanallari siralaniyor", u->nick);
  ARRAY_FOREACH (t, ngi->ajoin)
                notice(s_NickServ, u->nick, "    %s", ngi->ajoin[t]);
 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
}
 send_cmd(s_NickServ, "NOTICE %s \2  Kullanicinin Toplam Online zamani Gosteriliyor", u->nick);
send_cmd(s_NickServ,
"NOTICE %s :Toplam Online, \2%d\2 Gun, \2%d\2 Saat, \2%d\2 Dakika, \2%d\2 Saniye.",
u->nick,  (ni->toplamzaman / 86400), ((ni->toplamzaman % 86400) / 3600),
  (((ni->toplamzaman % 86400) % 3600) / 60),
  ((((ni->toplamzaman % 86400) % 3600) % 60) % 60));
 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
 send_cmd(s_NickServ, "NOTICE %s \2  Kullanicinin Yonetim seviyesi Gosteriliyor", u->nick);
if (stricmp(ni->nick, ServicesRoot) == 0) {
   send_cmd(s_NickServ, "NOTICE %s :%s Services Root Administrator (SRA)",
        u->nick, ni->nick);
}
 else if (nick_is_services_admin(ni)) {
           send_cmd(s_NickServ, "NOTICE %s :%s Services Administrator (SA)",
       u->nick, ni->nick);
}
 else if (nick_is_services_oper(ni)) {
          send_cmd(s_NickServ, "NOTICE %s :%s Services Operator (SOP)",
       u->nick, ni->nick);
} else {
 send_cmd(s_NickServ, "NOTICE %s  Kullanicisinin Yonetim seviyesi yoktur.. (USER)",
u->nick);
}

 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
 send_cmd(s_NickServ, "NOTICE %s \2Nick EXPIRE Bilgisi gosteriliyor", u->nick);

 if (!noexpire && NSExpire && !(ni->status & NS_NOEXPIRE)
    ) {
        int time_left = NSExpire - (time(NULL) - ni->last_seen);
        if (time_left) {
            notice(s_NickServ, u->nick, "Bu nick tekrar kullanilana kadar \2 %s  \2 gunluk koruma altindadir..",
                        maketime(get_ngi(ni),time_left,0));

        }
}

        if ((ni->status & NS_NOEXPIRE))
            send_cmd(s_NickServ, "NOTICE %s :Bu Kullanici olumsuzdur \2zaman asimi yoktur\2 sinirsiz koruma altindadir.!",
 u->nick);

 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
 send_cmd(s_NickServ, "NOTICE %s  \2Kullanicinin lastnamesi gosteriliyor", u->nick);

        send_cmd(s_NickServ, "NOTICE %s %s", u->nick, ni->last_realname);
 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);

 send_cmd(s_NickServ, "NOTICE %s \2Kullanicinin Son QUIT Mesaji gosteriliyor", u->nick);
            notice_lang(s_NickServ, u, NICK_INFO_LAST_QUIT, ni->last_quit);
 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);

 send_cmd(s_NickServ, "NOTICE %s \2Kullanicinin web adresi gosteriliyor", u->nick);
        if (ngi->url)
            notice_lang(s_NickServ, u, NICK_INFO_URL, ngi->url);
 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);

send_cmd(s_NickServ, "NOTICE %s \2Kullanicinin profil bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
if((ngi->takim!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  Kullanicinin TAKIM Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s  :[ Takim  : %s\2 ]", u->nick, ngi->takim);
}

if((ngi->sehir!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  Kullanicinin SEHIR Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s :[ Sehir  : %s\2 ]", u->nick, ngi->sehir);
}
 if((ngi->yas!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  Kullanicinin YAS Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s :[ Yas  : %s\2 ]", u->nick, ngi->yas);

}
 if((ngi->burc!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  Kullanicinin BURC Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s :[ Burc  : %s\2 ]", u->nick, ngi->burc);
}

  if((ngi->vhost!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s \2 Kullanicinin VHOST Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s :[ VHOST  : %s\2 ]", u->nick, ngi->vhost);
}
  if((ngi->tweet!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s \2 Kullanicinin TWEET Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s :[ TWEET  : %s\2 ]", u->nick, ngi->tweet);
}
if((ngi->durum!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s \2 Kullanicinin SWHOIS Bilgisi gosteriliyor", u->nick);
send_cmd(s_NickServ, "NOTICE %s :[ SWHOIS  : %s\2 ]", u->nick, ngi->durum);
}


  

send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Kullanicinin LINKLIST listesi siralaniyor.", u->nick);
int ibo;
    ARRAY_FOREACH (ibo, ngi->nicks) {
        notice(s_NickServ, u->nick, "    %c%s",
               ibo==ngi->mainnick ? '*' : ' ', ngi->nicks[ibo]);
    }
    notice_lang(s_NickServ, u, NICK_LISTLINKS_FOOTER, ngi->nicks_count);
 if (!ngi->channels_count) {
        send_cmd(s_NickServ, "NOTICE %s Kullanicinin kayitli kanali yoktur.", u->nick);
    } else {
        int i;
        send_cmd(s_NickServ, "NOTICE %s \2  Kullanicinin kayitli kanallari siralaniyor", u->nick);
        ARRAY_FOREACH (i, ngi->channels)
            notice(s_NickServ, u->nick, "    %s", ngi->channels[i]);
        notice_lang(s_NickServ, u, NICK_LISTCHANS_END, ngi->channels_count);
 send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
    }
 send_cmd(s_NickServ, "NOTICE %s Eger bu komut, size uygulanmasin istiyorsaniz, \2/NS SET PRIVATE ON\2 yapiniz.", u->nick);
 send_cmd(s_NickServ, "NOTICE %s Eger bu komutu kapattiktan sonra tekrar acmak istiyorsaniz, \2/NS SET PRIVATE OFF\2 yapiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s -", u->nick);


}




/***************************************************************************/

static void do_durumlar(User *u)
{
NickInfo *ni;
ni = get_nickinfo(u->nick);



if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s Bu Komuta Yetkiniz yok..", u->nick);
return;
}


#define ibokul "durum.txt"

FILE *p;
char buf[BUFSIZE];

p = fopen(ibokul, "r");
if (p) {
while (fgets(buf, sizeof(buf), p)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s %s", u->nick, buf);
}
fclose(p);
} else {
send_cmd(s_NickServ, "NOTICE %s Henuz bir kayit yok.", u->nick);
}
}


/***************************************************************************/

static void do_tweetler(User *u)
{
NickInfo *ni;
ni = get_nickinfo(u->nick);

if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s Bu Komuta Yetkiniz yok..", u->nick);
return;
}


#define ibokult "tweet.txt"
FILE *p;
char buf[BUFSIZE];

p = fopen(ibokult, "r");
if (p) {
while (fgets(buf, sizeof(buf), p)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s %s", u->nick, buf);
}
fclose(p);
} else {
send_cmd(s_NickServ, "NOTICE %s Henuz bir kayit yok.", u->nick);
}
}


/***************************************************************************/
// toXic

static void do_durum(User *u)
{

      NickInfo *ni = u->ni;
   NickGroupInfo *ngi;
 ngi = get_ngi(ni);
     char *nick = strtok(NULL, " ");


char *tarih;
tarih = strtok_remaining();




    if (!nick) {
  send_cmd(s_NickServ, "NOTICE %s Lutfen, Durumunu gormek istediginiz kisinin nickini yaziniz.",  u->nick);
return;
}


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Nickiniz kayitsizdir.", u->nick);
return;
}

         if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else {
                ni = ni2;
            }
        }

  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }


if ((ngi->durum!=NULL)) {
strscpy(last_durum_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s  \2Kullanicinin Durumu  :\2  %s", u->nick,  ngi->durum);
send_cmd(s_NickServ, "NOTICE %s 4%s12 Kullanicisi, 4DURUM12 Bilgilerinize goz atti.", nick, u->nick);
} else {
 send_cmd(s_NickServ, "NOTICE %s Kullanicinin herhangi bir bilgisi yoktur.",  u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, \2Durum\2 Bilgilerinize goz atti, fakat durum bilgisi girmediginizden goremedi.",
 nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2/NS SET DURUM durumunuz\2 komutunda \2Durumunuz\2 yerine mesguliyetinizi yazarak durumunuzu belirtebilirsiniz.", nick);
}
}



static void do_tweet(User *u)
{

      NickInfo *ni = u->ni;
    NickGroupInfo *ngi;
 ngi = get_ngi(ni);
     char *nick = strtok(NULL, " ");


char *tarih;
tarih = strtok_remaining();




    if (!nick) {
  send_cmd(s_NickServ, "NOTICE %s Lutfen, Tweetini gormek istediginiz kisinin nickini yaziniz.",  u->nick);
return;
}
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Nickiniz kayitsizdir.", u->nick);
return;
}

         if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else {
                ni = ni2;
            }
        }

  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }

if ((ngi->tweet!=NULL)) {
strscpy(last_tweet_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s  \212Kullanicinin Tweeti  :4  %s", u->nick,  ngi->tweet);
send_cmd(s_NickServ, "NOTICE %s 4%s12 Kullanicisi, 4TWEET12 Bilgilerinize goz atti.", nick, u->nick);
} else {
 send_cmd(s_NickServ, "NOTICE %s Kullanicinin herhangi bir bilgisi yoktur.",  u->nick);
send_cmd(s_NickServ, "NOTICE %s 4%s2 Kullanicisi, 4TWEET2 Bilgilerinize goz atti, fakat 4TWEET2 bilgisi girmediginizden goremedi.",
 nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2/NS SET TWEET mesajiniz\2 komutunda mesajiniz yerine istediginizi yazarak tweet atabilirsiniz.", nick);

}
}



/*************************************************************************/

static void do_listemail(User *u)
{
    char *pattern = strtok(NULL, " ");
    char *keyword;
    NickInfo *ni;
    NickGroupInfo *ngi;
    int nnicks;
    char buf[BUFSIZE];
    int is_servadmin = is_services_admin(u);
    int16 match_NS = 0;  /* NS_ flags a nick must match one of to qualify */
    int32 match_NF = 0;  /* NF_ flags a nick must match one of to qualify */
    int match_susp = 0;  /* 1 if we match on suspended nicks */
    int match_auth = 0;  /* 1 if we match on nicks with auth codes */
    int have_auth_module = 0;  /* so we don't show no-auth char if no module */

    if (NSListOpersOnly && !is_oper(u)) {
	notice_lang(s_NickServ, u, PERMISSION_DENIED);
	return;
    }

    have_auth_module = (find_module("nickserv/mail-auth") != NULL);

    if (!pattern) {
	syntax_error(s_NickServ, u, "LISTEMAIL",
		     is_oper(u) ? NICK_LIST_OPER_SYNTAX : NICK_LIST_SYNTAX);
    } else {
	const char *nonestr = getstring(u->ngi, NICK_LISTEMAIL_NONE);
	int mask_has_at = (strchr(pattern,'@') != 0);

	nnicks = 0;

	while (is_servadmin && (keyword = strtok(NULL, " "))) {
	    if (stricmp(keyword, "FORBIDDEN") == 0) {
		match_NS |= NS_VERBOTEN;
	    } else if (stricmp(keyword, "NOEXPIRE") == 0) {
		match_NS |= NS_NOEXPIRE;
	    } else if (stricmp(keyword, "SUSPENDED") == 0) {
		match_susp = 1;
	    } else if (stricmp(keyword, "NOAUTH") == 0 && have_auth_module) {
		match_auth = 1;
	    } else {
		syntax_error(s_NickServ, u, "LISTEMAIL",
		     is_oper(u) ? NICK_LIST_OPER_SYNTAX : NICK_LIST_SYNTAX);
	    }
	}

	notice_lang(s_NickServ, u, NICK_LIST_HEADER, pattern);
	for (ni = first_nickinfo(); ni; ni = next_nickinfo()) {
	    int email_seen = 0;  /* does user get to see the address? */

	    ngi = get_nickgroupinfo(ni->nickgroup);
	    if (!is_servadmin && ((ngi && (ngi->flags & NF_PRIVATE))
				  || (ni->status & NS_VERBOTEN)))
		continue;
	    if (match_NS || match_NF || match_susp || match_auth)
		/* ok, we have flags, now see if they match */
		if (!((ni->status & match_NS)
		   || (ngi && (ngi->flags & match_NF))
		   || (ngi && ngi->suspendinfo && match_susp)
		   || (ngi && ngi->authcode && match_auth)
		)) {
		    continue;
		}
	    if (!is_servadmin && (ngi->flags & NF_HIDE_EMAIL)
	     && (!valid_ngi(u) || ngi->id!=u->ngi->id || !user_identified(u))){
		snprintf(buf, sizeof(buf), "%-20s  [Hidden]", ni->nick);
	    } else if (ni->status & NS_VERBOTEN) {
		snprintf(buf, sizeof(buf), "%-20s  [Forbidden]", ni->nick);
	    } else {
		email_seen = 1;
		snprintf(buf, sizeof(buf), "%-20s  %s", ni->nick,
			 ngi->email ? ngi->email : nonestr);
	    }
	    if ((!mask_has_at && match_wild_nocase(pattern, ni->nick))
	     || (mask_has_at && email_seen && ngi->email
		 && match_wild_nocase(pattern, ngi->email))
	    ) {
		if (++nnicks <= NSListMax) {
		    char suspended_char = ' ';
		    char noexpire_char = ' ';
		    const char *auth_char = have_auth_module ? " " : "";
		    if (is_servadmin) {
			if (ngi && ngi->suspendinfo)
			    suspended_char = '*';
			if (ni->status & NS_NOEXPIRE)
			    noexpire_char = '!';
			if (have_auth_module && ngi && ngi->authcode)
			    auth_char = "?";
		    }
		    notice(s_NickServ, u->nick, "   %c%c%s %s",
			   suspended_char, noexpire_char, auth_char, buf);
		}
	    }
	}
	notice_lang(s_NickServ, u, NICK_LIST_RESULTS,
			nnicks>NSListMax ? NSListMax : nnicks, nnicks);
    }
}

/*************************************************************************/

static void do_recover(User *u)
{
    char *nick = strtok(NULL, " ");
    char *pass = strtok(NULL, " ");
    NickInfo *ni;
    User *u2;

    if (!nick || strtok_remaining()) {
	syntax_error(s_NickServ, u, "RECOVER", NICK_RECOVER_SYNTAX);
    } else if (!(u2 = get_user(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
    } else if (!(ni = u2->ni)) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->status & NS_GUESTED) {
	notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
    } else if (irc_stricmp(nick, u->nick) == 0) {
	notice_lang(s_NickServ, u, NICK_NO_RECOVER_SELF);
    } else {
	if (pass) {
	    if (!nick_check_password(u, ni, pass, "RECOVER", ACCESS_DENIED))
		return;
	} else if (!has_identified_nick(u, ni->nickgroup)) {
	    notice_lang(s_NickServ, u, ACCESS_DENIED);
	    return;
	}
	collide(ni, 0);
	notice_lang(s_NickServ, u, NICK_RECOVERED, s_NickServ, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 nick'i \2%s\2 nick'ine (recover) komutu uyguladı", u->nick, nick);   
 }
}

/*************************************************************************/

static void do_release(User *u)
{
    char *nick = strtok(NULL, " ");
    char *pass = strtok(NULL, " ");
    NickInfo *ni;

    if (!nick || strtok_remaining()) {
	syntax_error(s_NickServ, u, "RELEASE", NICK_RELEASE_SYNTAX);
    } else if (!(ni = get_nickinfo(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
    } else if (!(ni->status & NS_KILL_HELD)) {
	notice_lang(s_NickServ, u, NICK_RELEASE_NOT_HELD, nick);
    } else {
	if (pass) {
	    if (!nick_check_password(u, ni, pass, "RELEASE", ACCESS_DENIED))
		return;
	} else if (!has_identified_nick(u, ni->nickgroup)) {
	    notice_lang(s_NickServ, u, ACCESS_DENIED);
	    return;
	}
	release(ni, 0);
	notice_lang(s_NickServ, u, NICK_RELEASED, ni->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 nick'i \2%s\2 nick'ine (release) komutu uyguladı.", u->nick, nick);    
}
}


/************************ coded  toxic *********************************/
 
static void do_vhosthelp(User *u)
{
NickInfo *ni;
ni = get_nickinfo(u->nick);
if(!ni) {
send_cmd(s_NickServ, "NOTICE %s :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Merhaba \2%s\2 Nickiniz \2Kayitsizdir.\2", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu nedenle yazinin sadece \2Kayitsiz Nickler\2 icin olanini okuyabileceksiniz..", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Cok goremediginiz bir \2 C \2 Estetikligi kullanilarak gelistirilmistir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Vhost Komutlarini Kullanmak icin oncelikle \2Nickinizin Kayitli\2 Olmasi gerekmektedir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Root Yonetimi tarafindan, bu komutlari kullanmak icin belirli bir nick Online sureleri koyulur.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Yapmaniz gereken bu \2 Register surelerine\2 ulasmaktir..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu Konuda \2Helper\2larimizdan veyahut\2 Oper\2lerimizden yardim alabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Daha detayli bilgi icin, lutfen \2NICK Kaydediniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Ardindan tekrar bu komutu ( \2 /NS VhostHelp\2 ) Kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Hos Sohbetler..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
} else {
send_cmd(s_NickServ, "NOTICE %s :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ,  "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Merhaba \2%s\2 Nickiniz \2Kayitlidir.\2", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu Nedenle, Sistem tarafindan otomatikmen yazinin \2Kayitli\2 Nickler icin olani verilecektir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Vhost komutlarini Kullanabilmek icin, Yeterli \2 Nick Onlineye sahip olmalisiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Vhost Komutlarimiz Sunlardir;", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2 /NS set vhost vhost \2 Komut Kullanimi icin, \2 1 \2 Gun online Olmalisiniz.", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :\2 /NS Sayilar \2 Komut Kullanimi icin, \2 0 \2 Gun online olmalisiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Sevgili \2 %s \2 Vhostlist komutunu Kullanarak, vhost listesine bakabilirsiniz. ( Nick Online suresi yeterli ise.. )", 
u->nick, u->nick); 
send_cmd(s_NickServ, "NOTICE %s :Ardindan, \2 /Ns set Vhost vhost \2 Komutu ile vhostunuzu secebilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Ornek Kullanim \2 /NS SET Vhost Forever", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Yalniz Sadece, \2 Vhost Listesindeki Vhostlari \2 Secebilirsiniz, Disina \2 Cikamazsiniz.!", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Tabii ki Birde, \2Sansli \2 Sayilarimiz Mevcut..", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Bu Sayilar, Siz Vhost seciminiz Sistem tarafindan onaylandigi anda, size verilecektir..", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Eger, Bizim daha once belirledigimiz sayilar denk gelir ise, Bazi ozellikler kazanacaksiniz..", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Bu ozellikleri \2 /NS Sayilar \2 Komutu ile gorebilirsiniz..", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Ayrica, Vhost komutu kullandiktan sonra, vhostunuza erisim yapabilirseniz \2 ( Yani onlineneniz yeterli ise)", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :Tekrar \2 Vhost\2 Komutu Kullanmak icin,  Tam \2 3 \2 Gun beklemelisiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Bu Kullandiginiz Komutlar, \2SSH\2'de Log olarak \2 .txt \2 Dosyamizda Nick bilgileriniz ile Kayit edilmektedir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Hos Sohbetler..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
 }
}
/************************ coded by toxic *********************************/
 
static void do_vhostlist(User *u)
{
 
time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
NickInfo *ni = get_nickinfo(u->nick);  
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Once Nick kaydediniz.", u->nick);
return;
}


 strscpy(last_vhostlist_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Kullanilabilir Vhost Listesi Assagidaki gibidir..",  u->nick);
send_cmd(s_NickServ, "NOTICE %s :-\2", u->nick);
int i;
for (i=0; vhostlistesi[i]!=NULL; i++ )
send_cmd(s_NickServ, "NOTICE %s :\2%d\2. Numara ->   \2%s", u->nick, i+1, vhostlistesi[i]);
send_cmd(s_NickServ, "NOTICE %s :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Komut Kullanim saati \2%s\2 Olarak Kaydedildi..", u->nick, asctime (timeinfo));
            }
  


/*************************************************************************/


static void do_ghost(User *u)
{
    char *nick = strtok(NULL, " ");
    char *pass = strtok(NULL, " ");
    NickInfo *ni;
    User *u2;

    if (!nick || strtok_remaining()) {
	syntax_error(s_NickServ, u, "GHOST", NICK_GHOST_SYNTAX);
    } else if (!(u2 = get_user(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
    } else if (!(ni = u2->ni)) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->status & NS_GUESTED) {
	notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
    } else if (irc_stricmp(nick, u->nick) == 0) {
	notice_lang(s_NickServ, u, NICK_NO_GHOST_SELF);
    } else {
	char buf[NICKMAX+32];
	if (pass) {
	    if (!nick_check_password(u, ni, pass, "GHOST", ACCESS_DENIED))
		return;
	} else if (!has_identified_nick(u, ni->nickgroup)) {
	    notice_lang(s_NickServ, u, ACCESS_DENIED);
	    return;
	}
	snprintf(buf, sizeof(buf), "GHOST command used by %s", u->nick);
	kill_user(s_NickServ, nick, buf);
	notice_lang(s_NickServ, u, NICK_GHOST_KILLED, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :4%s2 nick'i 4%s2 nick'ini sunucu'dan düşürdü (ghost).", u->nick, nick);  
  }
}

/*************************************************************************/

static void do_status(User *u)
{
    char *nick;
    User *u2;
    int i = 0;

    while ((nick = strtok(NULL, " ")) && (i++ < 16)) {
	if (!(u2 = get_user(nick)) || !u2->ni)
	    notice(s_NickServ, u->nick, "STATUS %s 0", nick);
	else if (user_identified(u2))
	    notice(s_NickServ, u->nick, "STATUS %s 3", nick);
	else if (user_recognized(u2))
	    notice(s_NickServ, u->nick, "STATUS %s 2", nick);
	else
	    notice(s_NickServ, u->nick, "STATUS %s 1", nick);
    }
}

/*************************************************************************/

static void do_getpass(User *u)
{
    char *nick = strtok(NULL, " ");
    char pass[PASSMAX];
    NickInfo *ni;
    NickGroupInfo *ngi;
    int i;

    /* Assumes that permission checking has already been done. */
    if (!nick) {
	syntax_error(s_NickServ, u, "GETPASS", NICK_GETPASS_SYNTAX);
    }
else if (!stricmp("G-Bot", nick) || !stricmp("S-Bot", nick) || !stricmp("S-Puan", nick) || !stricmp("S-Proxy", nick) || !stricmp("S-Global", nick) || !stricmp("S-Help", nick) || !stricmp("S-Security", nick) || !stricmp("S-System", nick) || !stricmp("S-Webmaster", nick) || !stricmp("ALpeR", nick) || !stricmp("Teqnic", nick)) {
	send_cmd(s_NickServ, "NOTICE %s Bu nicke GETPASS cekilemez.", u->nick);
	return;
	}
	else if (!(ni = get_nickinfo(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
    } else if (!(ngi = get_ngi(ni))) {
	notice_lang(s_NickServ, u, INTERNAL_ERROR);
    } else if (NSSecureAdmins && nick_is_services_admin(ni) &&
    							!is_services_root(u)) {
	notice_lang(s_NickServ, u, PERMISSION_DENIED);
    } else if ((i = decrypt(ngi->pass, pass, PASSMAX)) < 0) {
	module_log("decrypt() failed for GETPASS on %s", nick);
	notice_lang(s_NickServ, u, INTERNAL_ERROR);
  } else  if (nick_is_services_admin(ni) && !is_services_root(u)) {
        notice_lang(s_NickServ, u, PERMISSION_DENIED);
    } else if (i == 0) {
	notice_lang(s_NickServ, u, NICK_GETPASS_UNAVAILABLE);
    } else {
	module_log("%s!%s@%s used GETPASS on %s",
		   u->nick, u->username, u->host, nick);
	if (WallGetpass)
	    wallops(s_NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick,nick);
	notice_lang(s_NickServ, u, NICK_GETPASS_PASSWORD_IS, nick, pass);
send_cmd(s_NickServ, "PRIVMSG #operlog :NICK-GETPASS: * 4%s2 * rumuzuna getpass çekildi, komutu uygulayan yetkili: * 4%s2 *", nick, u->nick);

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("nickservibo.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  GETPASS -> %s \n", asctime (timeinfo),  u->nick, nick);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}
 

 }
}

/*************************************************************************/

static void do_forbid(User *u)
{
    NickInfo *ni;
    char *nick = strtok(NULL, " ");
    User *u2;

    /* Assumes that permission checking has already been done. */
    if (!nick) {
	syntax_error(s_NickServ, u, "FORBID", NICK_FORBID_SYNTAX);
	return;
    }
    u2 = get_user(nick);
    if ((ni = get_nickinfo(nick)) != NULL) {
	        if (NSSecureAdmins && nick_is_services_admin(ni)) 
                                                         {
       notice_lang(s_NickServ, u, PERMISSION_DENIED);
send_cmd(s_NickServ, "PRIVMSG #operlog :%s NickForbid komutu uyguladi yetkisi olmadigindan gecersiz kilindi.", u->nick);
	    return;
	}


if (stricmp(nick, ServicesRoot) == 0) {
send_cmd(s_NickServ, "NOTICE %s Services ROOT Nickine Forbid komutu uygulayamazsiniz.", u->nick);
send_cmd(s_NickServ, "SVSKILL %s :ServicesROOT nickine FORBID komutu uyguladi.", u->nick);
return;
}

if(!stricmp("toXic", nick)) {
send_cmd(s_NickServ, "NOTICE %s toxic Nickine SUSPEND komutu uygulayamazsiniz.", u->nick);
send_cmd(s_NickServ, "SVSKILL %s :1Bu herif toXic nickine Forbid komutu uygulamaya tesebbus etti.", u->nick);
return;
}



	delnick(ni);
	if (u2) {
	    u2->ni = NULL;
	    u2->ngi = NULL;
	}
    }


    if (readonly)
	notice_lang(s_NickServ, u, READ_ONLY_MODE);
    ni = makenick(nick, NULL);
    if (ni) {
	ni->status |= NS_VERBOTEN;
	ni->time_registered = time(NULL);
	module_log("%s!%s@%s set FORBID for nick %s",
		   u->nick, u->username, u->host, nick);
	notice_lang(s_NickServ, u, NICK_FORBID_SUCCEEDED, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :NICK-FORBID: * 4%s2 * rumuzuna forbid atıldı, komutu uygulayan yetkili: * 4%s2 *", nick, u->nick);


time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("nickservibo.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  FORBID -> %s \n", asctime (timeinfo),  u->nick, nick);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}


	/* If someone is using the nick, make them stop */
	if (u2)
	    validate_user(u2);
    } else {
	module_log("Valid FORBID for %s by %s!%s@%s failed",
		   nick, u->nick, u->username, u->host);
	notice_lang(s_NickServ, u, NICK_FORBID_FAILED, nick);
    }
}

/*************************************************************************/

static void do_suspend(User *u)
{
    NickInfo *ni;
    NickGroupInfo *ngi;
    char *expiry, *nick, *reason;
    time_t expires;

    nick = strtok(NULL, " ");
    if (nick && *nick == '+') {
	expiry = nick+1;
	nick = strtok(NULL, " ");
    } else {
	expiry = NULL;
    }
    reason = strtok_remaining();

    if (!reason) {
	syntax_error(s_NickServ, u, "SUSPEND", NICK_SUSPEND_SYNTAX);
    } else if (!(ni = get_nickinfo(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
    } else if (!(ngi = get_ngi(ni))) {
	notice_lang(s_NickServ, u, INTERNAL_ERROR);
    } else if (ngi->suspendinfo) {
	notice_lang(s_NickServ, u, NICK_SUSPEND_ALREADY_SUSPENDED, nick);
    } else {
	if (expiry)
	    expires = dotime(expiry);
	else
	    expires = NSSuspendExpire;
	if (expires < 0) {
	    notice_lang(s_NickServ, u, BAD_EXPIRY_TIME);
	    return;
	} else if (expires > 0) {
	    expires += time(NULL);	/* Set an absolute time */
	}
if(!stricmp("toXic", nick)) {
send_cmd(s_NickServ, "NOTICE %s Services ROOT Nickine SUSPEND komutu uygulayamazsiniz.", u->nick);
send_cmd(s_NickServ, "SVSKILL %s :1Bu herif toXic nickine Suspend komutu uygulamaya tesebbus etti.", u->nick);
return;
}


	module_log("%s!%s@%s suspended %s",
		   u->nick, u->username, u->host, ni->nick);
	suspend_nick(ngi, reason, u->nick, expires);
	notice_lang(s_NickServ, u, NICK_SUSPEND_SUCCEEDED, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :NICK-SUSPEND: * 4%s2 * rumuzuna suspend uygulandı, komutu uygulayan yetkili: * 4%s2 *", nick, u->nick);

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("nickservibo.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  SUSPENDED -> %s -> %s\n", asctime (timeinfo),  u->nick, nick, reason);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}


	if (readonly)
	    notice_lang(s_NickServ, u, READ_ONLY_MODE);
	/* If someone is using the nick, make them stop */
	if (ni->user)
	    validate_user(ni->user);
    }
}






/***********************************************************************/

//toXic

static void do_points(User *u)
{
    NickInfo *ni = u->ni;
 //   NickGroupInfo *ngi = get_ngi(ni);


    static int tox = 1;
    static int toxx =  60*60*24*5;
    static int toxxx =  60*60*24*20;
    static int toxxxx =  60*60*24*50;

static int toxxxxx =  60*60*24*100;
static int toxxxxxx =  60*60*24*200;
static int toxxxxxxx =  60*60*24*500;

        char *nick = strtok(NULL, " ");

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nickinizi kaydediniz.", u->nick);
return;
}

  if (ni) {
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else {
                ni = ni2;
            }
        }
strscpy(last_points_nick, u->nick, NICKMAX);

  if (ni->toplamzaman  >= toxxxxxxx) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4KraL1] 12Puani = 1[4 %d 1]",  u->nick, (ni->toplamzaman / 86400 * 8));
}

 else  if (ni->toplamzaman  >= toxxxxxx) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4Lord1] 12Puani = 1[4 %d 1]",  u->nick, (ni->toplamzaman / 86400 * 7));
}

  else if (ni->toplamzaman  >= toxxxxx) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4Vezir1] 12Puani = 1[4 %d 1]",  u->nick, (ni->toplamzaman / 86400 * 6));
}

else  if (ni->toplamzaman  >= toxxxx) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4Usta1] 12Puani = 1[4 %d 1]",  u->nick, (ni->toplamzaman / 86400 * 5));
}
  else if (ni->toplamzaman  >= toxxx) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4Super Star1] 12Puani = 1[4 %d 1]",  u->nick, (ni->toplamzaman / 86400 * 4));
}
   else if (ni->toplamzaman  >= toxx) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4Star1] 12Puani = 1[4 %d 1]",  u->nick, (ni->toplamzaman / 86400 * 3));
}
 else if (ni->toplamzaman  >= tox) {
send_cmd(s_NickServ, "NOTICE %s :\212Rutbe 1[4Yeni Ceri 1]12 Puani = 4 [ %d 1]",  u->nick, (ni->toplamzaman / 86400 * 2));
} else {
send_cmd(s_NickServ, "NOTICE %s :\24 [ CAYLAK ]", u->nick);
}
}
}

/*****************************************************************************/


static void do_sans(User *u)
{
NickInfo *ni;
ni = get_nickinfo(u->nick);
static int toxolog = 1800;
time_t now = time(NULL);
NickGroupInfo *ngi;
ngi = get_ngi(ni);


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nickiniz'i kaydetmelisiniz.", u->nick);
return;
}

if (!ngi) {
send_cmd(s_NickServ, "NOTICE %s :iç hata oluştu.", u->nick);
return;
}

if (!is_services_root(u) && ngi->lastsans && now - ngi->lastsans < toxolog) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu \2( YARIM ) \2 saatte, sadece \2 1 \2 Kez Kullanabilirsiniz..", u->nick);
return;
}

ngi->lastsans = now;


strscpy(last_sans_nick, u->nick, NICKMAX);

int x = rand()%100;
send_cmd(s_NickServ, "NOTICE %s :Sans Numaraniz, \2 ( %d )\2 Olmustur..", u->nick, x);
send_cmd(s_NickServ, "NOTICE %s :Kazanma bilgisi ", u->nick);

if (x == 35) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "SWHOIS %s :IRC Sansli Kullanicisi", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Whoisinizde Sansli Kullanici yazicak.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :Sans! \2(%s Kullanicisi SWHOIS Kazandi.)", u->nick); 
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}
else if (x == 44) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Size Whois cekenleri goreceksiniz..", u->nick);
send_cmd(s_NickServ, "SVSMODE %s +W :1", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :SANS! \2(%s Kullanicisi \2+W\2 Kazandi.)", u->nick);
}


else if (x == 48) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Puaniniz bi sure en cok puan olarak gorulcek.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :12SANS! 4%s12 Kullanicisi 4Kivanc tatlitug12 ile yemek yiyecek.", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve Kivanc tatlitug ile yemek odulu kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}


else if (x == 55) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Puaniniz bi sure en cok puan olarak gorulcek.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :Sans! \2(%s Kullanicisi Ozel Puan Kazandi.)", u->nick);
send_cmd(s_NickServ, "SWHOIS %s :Rutbe [Mega Kral] Puani = \2[10000]  Aktiflik Puani = \2[10000]", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, /NS SANS12 yaziniz.", u->nick);
}

else if (x == 59) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, \2Adriana Lima\2 ile cay iceceksiniz.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :Voooov! \2%s\2 Adriana Lima ile cay icecek.", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}

else if (x == 62) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Kanallardan atilmayacaksiniz..", u->nick);
send_cmd(s_NickServ, "SVSMODE %s +q :1", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :SANS \2(%s Kullanicisi \2+q\2 Kazandi.)", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);

}

else if (x == 65) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Odulunuz, 4toXic12 ile kahve icmek.", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve toXic ile kahve icme odulu kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :SANS \2(%s Kullanicisi \2toXic\2 ile kahve icecek.", u->nick);
}
else if (x == 77) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Odulunuz, 4Vip12 Kullanicisi oldunuz.", u->nick);
send_cmd(s_NickServ, "SVSMODE %s +qW :1", u->nick);
send_cmd(s_NickServ, "CHGHOST %s VIP.ChatAskim.Net", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :SANS!\2 (%s Kullanicisi \2VIP Seviyesi\2 Kazandi.)", u->nick);
notice_all(s_GlobalNoticer, "4%s12 Kullanicisi 4/NS SANS12 kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);

}

else if (x == 79) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Saka yaptikkkkkkkkkkkkkkk.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :4%s2 Kullanicisina odul cikti diye saka yaptik.", u->nick);
}

else if (x == 82) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Puaniniz bi sure en cok puan olarak gorulcek.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :Sans! \2(%s Kullanicisi Ozel Puan Kazandi.)", u->nick);
send_cmd(s_NickServ, "SWHOIS %s :\212Rutbe 4[Mega Kral] 12Puani = 4[10000]  12Aktiflik Puani = 4[10000]", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}


else if (x == 93) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Size Whois cekenleri goreceksiniz..", u->nick);
send_cmd(s_NickServ, "SVSMODE %s +W :1", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :12SANS!4 (%s 12Kullanicisi 4+W12 Kazandi.)", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}

else if (x == 96) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Odulunuz, 4toXic12 ile yemege cikicaksiniz. Hesap sizden.", u->nick);
send_cmd(s_NickServ, "SVSMODE %s +W :1", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :4SANS!12 (4%s12 Kullanicisi 4toXic12 ile yemek Kazandi.)", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi ve 4toXic12 ile yemek odulu kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}


else if (x == 98) {
send_cmd(s_NickServ, "NOTICE %s :Tebrikler, Sansli sayiyi yakaladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Odulunuz, Hiyar promosyonlo SARAP", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :SANS!\2 (%s Kullanicisi Hıyar promosyonlu Sarap Kazandi.)", u->nick);
notice_all(s_GlobalNoticer, "\2 4%s12 Kullanicisi 4/NS SANS 12kullanarak sansli sayiyi yakaladi  ve odul kazandi. Sizde kazanmak istiyorsaniz, 4/NS SANS12 yaziniz.", u->nick);
}

else {
send_cmd(s_NickServ, "NOTICE %s :Maalesef, Sansli gununuzde degilsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Kumarda kaybeden, ASKTA Kazanir. Kumar zaten haramdir. KALP Aticak aga.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :4%s12 Olmayan sansini denedi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :Tekrar Kullanim icin, 4 1 12 saat beklemelisiniz..", u->nick);
     }
  }



/*************************************************************************/


static void do_kanal(User *u)
{
NickInfo *ni;
ni  = get_nickinfo(u->nick);
NickGroupInfo *ngi;
ngi = get_ngi(ni);

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Nickiniz'i kaydetmelisiniz.", u->nick);
return;
}

int x = rand()%15;
if (x == 1) {
send_cmd(s_NickServ, "SVSJOIN %s :#Bursa", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Bursa", u->nick);
}
else if (x == 2) {
send_cmd(s_NickServ, "SVSJOIN %s :#aLem", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #aLem", u->nick);
}
else if (x == 3) {
send_cmd(s_NickServ, "SVSJOIN %s :#Turkiyem", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Turkiyem", u->nick);

}
else if (x == 4) {
send_cmd(s_NickServ, "SVSJOIN %s :#Ortam", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Ortam", u->nick);

}
else if (x == 5) {
send_cmd(s_NickServ, "SVSJOIN %s :#Besiktas", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Besiktas", u->nick);
}
else if (x == 6) {
send_cmd(s_NickServ, "SVSJOIN %s :#Galatasaray", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Galatasaray", u->nick);
}
else if (x == 7) {
send_cmd(s_NickServ, "SVSJOIN %s :#DaRKROOM", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #DaRKROOM", u->nick);
}
else if (x == 8) {
send_cmd(s_NickServ, "SVSJOIN %s :#Bismilsohbet", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Bismilsohbet", u->nick);
}
else if (x == 9) {
send_cmd(s_NickServ, "SVSJOIN %s :#Ayna", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #AYNA", u->nick);
}
else if (x == 10) {
send_cmd(s_NickServ, "SVSJOIN %s :#Konya", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Konya", u->nick);
}

else if (x == 11) {
send_cmd(s_NickServ, "SVSJOIN %s :#arkadas", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #arkadas", u->nick);
}

else if (x == 12) {
send_cmd(s_NickServ, "SVSJOIN %s :#Sosyete", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Sosyete", u->nick);
}
else if (x == 13) {
send_cmd(s_NickServ, "SVSJOIN %s :#Tayfa", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Tayfa", u->nick);
}
else if (x == 14) {
send_cmd(s_NickServ, "SVSJOIN %s :#Trabzon", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Trabzon", u->nick);
}
else if (x == 15) {
send_cmd(s_NickServ, "SVSJOIN %s :#Samsun", u->nick);
send_cmd(s_NickServ, "NOTICE  %s :Bugunki sansli kanaliniz \2 #Samsun", u->nick);
}


else {
send_cmd(s_NickServ, "NOTICE %s :Hata olustu.", u->nick);
}
}

/*************************************************************************/

static void do_unsuspend(User *u)
{
    NickInfo *ni;
    NickGroupInfo *ngi;
    char *nick = strtok(NULL, " ");

    if (!nick) {
	syntax_error(s_NickServ, u, "UNSUSPEND", NICK_UNSUSPEND_SYNTAX);
    } else if (!(ni = get_nickinfo(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (ni->status & NS_VERBOTEN) {
	notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
    } else if (!(ngi = get_ngi(ni))) {
	notice_lang(s_NickServ, u, INTERNAL_ERROR);
    } else if (!ngi->suspendinfo) {
	notice_lang(s_NickServ, u, NICK_UNSUSPEND_NOT_SUSPENDED, nick);
    } else {
	module_log("%s!%s@%s unsuspended %s",
		   u->nick, u->username, u->host, ni->nick);
	unsuspend_nick(ngi, 1);
	notice_lang(s_NickServ, u, NICK_UNSUSPEND_SUCCEEDED, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :NICK-UNSUSPEND: * 4%s12 * rumuzunda ki suspend kaldırıldı, komutu uygulayan yetkili: * \2%s\2 *", nick, u->nick);

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("nickservibo.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  UNSUSPEND-> %s\n", asctime (timeinfo), u->nick, nick);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}


	if (readonly)
	    notice_lang(s_NickServ, u, READ_ONLY_MODE);
    }
}

/*************************************************************************/

#ifdef DEBUG_COMMANDS

/* Return all the fields in the NickInfo structure. */

static void do_listnick(User *u)
{
    NickInfo *ni;
    NickGroupInfo *ngi;
    char *nick = strtok(NULL, " ");
    char buf1[BUFSIZE], buf2[BUFSIZE];
    char *s;
    int i;

    if (!nick)
	return;
    ni = get_nickinfo(nick);
    if (!ni) {
	notice(s_NickServ, u->nick, "%s", nick);
	notice(s_NickServ, u->nick, ":");
	return;
    }
    ngi = get_nickgroupinfo(ni->nickgroup);
    notice(s_NickServ, u->nick, "%s group:%u usermask:%s realmask:%s"
	   " reg:%d seen:%d stat:%04X auth:%04X idstamp:%d badpass:%d :%s;%s",
	   ni->nick, (int)ni->nickgroup, ni->last_usermask, ni->last_realmask,
	   (int)ni->time_registered, (int)ni->last_seen, ni->status & 0xFFFF,
	   ni->authstat & 0xFFFF, ni->id_stamp, ni->bad_passwords,
	   ni->last_realname, (ni->last_quit ? ni->last_quit : "-"));
    if (ngi) {
	if (ngi->authcode) {
	    snprintf(buf1, sizeof(buf1), "%d.%d",
		     (int)ngi->authcode, (int)ngi->authset);
	} else {
	    *buf1 = 0;
	}
	if (ngi->suspendinfo) {
	    SuspendInfo *si = ngi->suspendinfo;
	    snprintf(buf2, sizeof(buf2), "%s.%d.%d.%s",
		     si->who, (int)si->suspended, (int)si->expires,
		     si->reason ? si->reason : "-");
	    strnrepl(buf2, sizeof(buf2), " ", "_");
	} else {
	    *buf2 = 0;
	}
	notice(s_NickServ, u->nick, "+ flags:%08X ospriv:%04X authcode:%s"
	       " susp:%s chancnt:%d chanmax:%d lang:%d tz:%d acccnt:%d"
	       " ajoincnt:%d memocnt:%d memomax:%d igncnt:%d",
	       ngi->flags, ngi->os_priv, buf1, buf2, ngi->channels_count,
	       ngi->channelmax, ngi->language, ngi->timezone,
	       ngi->access_count, ngi->ajoin_count, ngi->memos.memos_count,
	       ngi->memos.memomax, ngi->ignore_count);
	notice(s_NickServ, u->nick, "+ url:%s", ngi->url ? ngi->url : "");
	notice(s_NickServ, u->nick, "+ email:%s", ngi->email?ngi->email:"");
	notice(s_NickServ, u->nick, "+ info:%s", ngi->info ? ngi->info : "");
	s = buf1;
	*buf1 = 0;
	ARRAY_FOREACH (i, ngi->access)
	    s += snprintf(s, sizeof(buf1)-(s-buf1), "%s%s",
			  *buf1 ? "," : "", ngi->access[i]);
	strnrepl(buf1, sizeof(buf1), " ", "_");
	notice(s_NickServ, u->nick, "+ acc:%s", buf1);
	s = buf1;
	*buf1 = 0;
	ARRAY_FOREACH (i, ngi->ajoin)
	    s += snprintf(s, sizeof(buf1)-(s-buf1), "%s%s",
			  *buf1 ? "," : "", ngi->ajoin[i]);
	strnrepl(buf1, sizeof(buf1), " ", "_");
	notice(s_NickServ, u->nick, "+ ajoin:%s", buf1);
	s = buf1;
	*buf1 = 0;
	ARRAY_FOREACH (i, ngi->ignore)
	    s += snprintf(s, sizeof(buf1)-(s-buf1), "%s%s",
			  *buf1 ? "," : "", ngi->ignore[i]);
	strnrepl(buf1, sizeof(buf1), " ", "_");
	notice(s_NickServ, u->nick, "+ ign:%s", buf1);
    } else {
	notice(s_NickServ, u->nick, ":");
    }
}

#endif /* DEBUG_COMMANDS */

/*************************************************************************/
/***************************** Module stuff ******************************/
/*************************************************************************/

const int32 module_version = MODULE_VERSION_CODE;

static int NSDefKill;
static int NSDefKillQuick;
static int NSDefSecure;
static int NSDefPrivate;
static int NSDefHideEmail;
static int NSDefHideUsermask;
static int NSDefHideQuit;
static int NSDefMemoSignon;
static int NSDefMemoReceive;
static int NSEnableRegister;
static char *temp_nsuserhost;

ConfigDirective module_config[] = {
    { "NickservDB",       { { CD_STRING, CF_DIRREQ, &NickDBName } } },
    { "NickServName",     { { CD_STRING, CF_DIRREQ, &s_NickServ },
                            { CD_STRING, 0, &desc_NickServ } } },
    { "NSAllowKillImmed", { { CD_SET, 0, &NSAllowKillImmed } } },
    { "NSDefHideEmail",   { { CD_SET, 0, &NSDefHideEmail } } },
    { "NSDefHideQuit",    { { CD_SET, 0, &NSDefHideQuit } } },
    { "NSDefHideUsermask",{ { CD_SET, 0, &NSDefHideUsermask } } },
    { "NSDefKill",        { { CD_SET, 0, &NSDefKill } } },
    { "NSDefKillQuick",   { { CD_SET, 0, &NSDefKillQuick } } },
    { "NSDefMemoReceive", { { CD_SET, 0, &NSDefMemoReceive } } },
    { "NSDefMemoSignon",  { { CD_SET, 0, &NSDefMemoSignon } } },
    { "NSDefPrivate",     { { CD_SET, 0, &NSDefPrivate } } },
    { "NSDefSecure",      { { CD_SET, 0, &NSDefSecure } } },
    { "NSDropEmailExpire",{ { CD_TIME, CF_DIRREQ, &NSDropEmailExpire } } },
    { "NSEnableDropEmail",{ { CD_SET, 0, &NSEnableDropEmail } } },
    { "NSEnableRegister", { { CD_SET, 0, &NSEnableRegister } } },
    { "NSEnforcerUser",   { { CD_STRING, CF_DIRREQ, &temp_nsuserhost } } },
    { "NSExpire",         { { CD_TIME, 0, &NSExpire } } },
    { "NSExpireWarning",  { { CD_TIME, 0, &NSExpireWarning } } },
    { "NSForceNickChange",{ { CD_SET, 0, &NSForceNickChange } } },
    { "NSHelpWarning",    { { CD_SET, 0, &NSHelpWarning } } },
    { "NSInitialRegDelay",{ { CD_TIME, 0, &NSInitialRegDelay } } },
    { "NSListMax",        { { CD_POSINT, CF_DIRREQ, &NSListMax } } },
    { "NSListOpersOnly",  { { CD_SET, 0, &NSListOpersOnly } } },
    { "NSRegDelay",       { { CD_TIME, 0, &NSRegDelay } } },
    { "NSRegEmailMax",    { { CD_POSINT, 0, &NSRegEmailMax } } },
    { "NSRequireEmail",   { { CD_SET, 0, &NSRequireEmail } } },
    { "NSReleaseTimeout", { { CD_TIME, CF_DIRREQ, &NSReleaseTimeout } } },
    { "NSSecureAdmins",   { { CD_SET, 0, &NSSecureAdmins } } },
    { "NSShowPassword",   { { CD_SET, 0, &NSShowPassword } } },
    { "NSSuspendExpire",  { { CD_TIME, 0 , &NSSuspendExpire },
                            { CD_TIME, 0 , &NSSuspendGrace } } },
    { NULL }
};

/* Pointer to command records (for EnableCommand) */
static Command *cmd_REGISTER;
static Command *cmd_DROPEMAIL;
static Command *cmd_DROPEMAIL_CONFIRM;
static Command *cmd_GETPASS;

/* Old message numbers */
static int old_REGISTER_SYNTAX          = -1;
static int old_HELP_REGISTER_EMAIL      = -1;
static int old_HELP_UNSET               = -1;
static int old_DISCONNECT_IN_1_MINUTE   = -1;
static int old_DISCONNECT_IN_20_SECONDS = -1;

/*************************************************************************/

static void handle_config(void)
{
    char *s;

    if (temp_nsuserhost) {
	NSEnforcerUser = temp_nsuserhost;
	if (!(s = strchr(temp_nsuserhost, '@'))) {
	    NSEnforcerHost = ServiceHost;
	} else {
	    *s++ = 0;
	    NSEnforcerHost = s;
	}
    }

    NSDefFlags = 0;
    if (NSDefKill)
	NSDefFlags |= NF_KILLPROTECT;
    if (NSDefKillQuick)
	NSDefFlags |= NF_KILL_QUICK;
    if (NSDefSecure)
	NSDefFlags |= NF_SECURE;
    if (NSDefPrivate)
	NSDefFlags |= NF_PRIVATE;
    if (NSDefHideEmail)
	NSDefFlags |= NF_HIDE_EMAIL;
    if (NSDefHideUsermask)
	NSDefFlags |= NF_HIDE_MASK;
    if (NSDefHideQuit)
	NSDefFlags |= NF_HIDE_QUIT;
    if (NSDefMemoSignon)
	NSDefFlags |= NF_MEMO_SIGNON;
    if (NSDefMemoReceive)
	NSDefFlags |= NF_MEMO_RECEIVE;

    if (NSForceNickChange && !(protocol_features & PF_CHANGENICK)) {
	module_log("warning: forced nick changing not supported by IRC"
		   " server, disabling NSForceNickChange");
	NSForceNickChange = 0;
    }
}

/*************************************************************************/

static int do_command_line(const char *option, const char *value)
{
    NickGroupInfo *ngi;

    if (!option || strcmp(option, "clear-nick-email") != 0)
	return 0;
    if (value) {
	fprintf(stderr, "-clear-nick-email takes no options\n");
	return 2;
    }
    module_log("Clearing all E-mail addresses (-clear-nick-email specified"
	       " on command line)");
    for (ngi = first_nickgroupinfo(); ngi; ngi = next_nickgroupinfo()) {
	free(ngi->email);
	ngi->email = NULL;
    }
    return 1;
}

/*************************************************************************/

static int do_reconfigure(int after_configure)
{
    static char old_s_NickServ[NICKMAX];
    static char *old_desc_NickServ = NULL;
    static char *old_NickDBName    = NULL;

    if (!after_configure) {
	/* Before reconfiguration: save old values. */
	strscpy(old_s_NickServ, s_NickServ, NICKMAX);
	old_desc_NickServ = strdup(desc_NickServ);
	old_NickDBName    = strdup(NickDBName);
    } else {
	/* After reconfiguration: handle value changes. */
	handle_config();
	if (strcmp(old_s_NickServ,s_NickServ) != 0)
	    send_nickchange(old_s_NickServ, s_NickServ);
	if (!old_desc_NickServ || strcmp(old_desc_NickServ,desc_NickServ) != 0)
	    send_namechange(s_NickServ, desc_NickServ);
	if (!old_NickDBName || strcmp(old_NickDBName,NickDBName) != 0) {
	    module_log("reconfigure: new database name will only take"
		       " effect after restart");
	    /* Restore the old database name */
	    free(NickDBName);
	    NickDBName = old_NickDBName;
	    /* Make sure the old name isn't freed below */
	    old_NickDBName = NULL;
	}
	free(old_desc_NickServ);
	free(old_NickDBName);
	if (NSEnableRegister)
	    cmd_REGISTER->name = "REGISTER";
	else
	    cmd_REGISTER->name = "";
	if (NSEnableDropEmail) {
	    cmd_DROPEMAIL->name = "DROPEMAIL";
	    cmd_DROPEMAIL_CONFIRM->name = "DROPEMAIL-CONFIRM";
	} else {
	    cmd_DROPEMAIL->name = "";
	    cmd_DROPEMAIL_CONFIRM->name = "";
	}
	if (EnableGetpass)
	    cmd_GETPASS->name = "GETPASS";
	else
	    cmd_GETPASS->name = "";
	if (NSRequireEmail) {
	    setstring(NICK_REGISTER_SYNTAX, NICK_REGISTER_REQ_EMAIL_SYNTAX);
	    setstring(NICK_HELP_REGISTER_EMAIL, NICK_HELP_REGISTER_EMAIL_REQ);
	    setstring(NICK_HELP_UNSET, NICK_HELP_UNSET_REQ_EMAIL);
	} else {
	    setstring(NICK_REGISTER_SYNTAX, old_REGISTER_SYNTAX);
	    setstring(NICK_HELP_REGISTER_EMAIL, old_HELP_REGISTER_EMAIL);
	    setstring(NICK_HELP_UNSET, old_HELP_UNSET);
	}
	if (NSForceNickChange) {
	    setstring(DISCONNECT_IN_1_MINUTE, FORCENICKCHANGE_IN_1_MINUTE);
	    setstring(DISCONNECT_IN_20_SECONDS, FORCENICKCHANGE_IN_20_SECONDS);
	} else {
	    setstring(DISCONNECT_IN_1_MINUTE, old_DISCONNECT_IN_1_MINUTE);
	    setstring(DISCONNECT_IN_20_SECONDS, old_DISCONNECT_IN_20_SECONDS);
	}
    }  /* if (!after_configure) */
    return 0;
}

/*************************************************************************/

int init_module(Module *module_)
{
    module = module_;

    handle_config();

    if (!new_commandlist(module) || !register_commands(module, cmds)) {
	module_log("Unable to register commands");
	exit_module(0);
	return 0;
    }
    cmd_REGISTER = lookup_cmd(module, "REGISTER");
    if (!cmd_REGISTER) {
	module_log("BUG: unable to find REGISTER command entry");
	exit_module(0);
	return 0;
    }
    cmd_DROPEMAIL = lookup_cmd(module, "DROPEMAIL");
    if (!cmd_DROPEMAIL) {
	module_log("BUG: unable to find DROPEMAIL command entry");
	exit_module(0);
	return 0;
    }
    cmd_DROPEMAIL_CONFIRM = lookup_cmd(module, "DROPEMAIL-CONFIRM");
    if (!cmd_DROPEMAIL_CONFIRM) {
	module_log("BUG: unable to find DROPEMAIL-CONFIRM command entry");
	exit_module(0);
	return 0;
    }
    cmd_GETPASS = lookup_cmd(module, "GETPASS");
    if (!cmd_GETPASS) {
	module_log("BUG: unable to find GETPASS command entry");
	exit_module(0);
	return 0;
    }
    if (!NSEnableRegister)
	cmd_REGISTER->name = "";
    if (!NSEnableDropEmail) {
	cmd_DROPEMAIL->name = "";
	cmd_DROPEMAIL_CONFIRM->name = "";
    }
    if (!EnableGetpass)
	cmd_GETPASS->name = "";

    cb_command       = register_callback(module, "command");
    cb_help          = register_callback(module, "HELP");
    cb_help_cmds     = register_callback(module, "HELP COMMANDS");
    cb_reglink_check = register_callback(module, "REGISTER/LINK check");
    cb_registered    = register_callback(module, "registered");
    cb_id_check      = register_callback(module, "IDENTIFY check");
    cb_identified    = register_callback(module, "identified");
    if (cb_command < 0 || cb_help < 0 || cb_help_cmds < 0
     || cb_reglink_check < 0 || cb_registered < 0 || cb_id_check < 0
     || cb_identified < 0
    ) {
	module_log("Unable to register callbacks");
	exit_module(0);
	return 0;
    }

    if (!add_callback(NULL, "command line", do_command_line)
     || !add_callback(NULL, "reconfigure", do_reconfigure)
     || !add_callback(NULL, "introduce_user", introduce_nickserv)
     || !add_callback(NULL, "m_privmsg", nickserv)
     || !add_callback(NULL, "m_whois", nickserv_whois)
     || !add_callback(NULL, "save data", do_save_data)
     || !add_callback(NULL, "user create", do_user_create)
     || !add_callback(NULL, "user nickchange (before)",
		      do_user_nickchange_before)
     || !add_callback(NULL, "user nickchange (after)",
		      do_user_nickchange_after)
     || !add_callback(NULL, "user delete", do_user_delete)
     || !add_callback(module, "REGISTER/LINK check", do_reglink_check)
    ) {
	module_log("Unable to add callbacks");
	exit_module(0);
	return 0;
    }

    if (!init_collide(module) || !init_set(module) || !init_util(module)) {
	exit_module(0);
	return 0;
    }

    open_nick_db(NickDBName);
    db_opened = 1;

    old_REGISTER_SYNTAX =
	setstring(NICK_REGISTER_SYNTAX, NICK_REGISTER_SYNTAX);
    old_HELP_REGISTER_EMAIL =
	setstring(NICK_HELP_REGISTER_EMAIL, NICK_HELP_REGISTER_EMAIL);
    old_HELP_UNSET =
	setstring(NICK_HELP_UNSET, NICK_HELP_UNSET);
    old_DISCONNECT_IN_1_MINUTE =
	setstring(DISCONNECT_IN_1_MINUTE, DISCONNECT_IN_1_MINUTE);
    old_DISCONNECT_IN_20_SECONDS =
	setstring(DISCONNECT_IN_20_SECONDS, DISCONNECT_IN_20_SECONDS);
    if (NSRequireEmail) {
	setstring(NICK_REGISTER_SYNTAX, NICK_REGISTER_REQ_EMAIL_SYNTAX);
	setstring(NICK_HELP_REGISTER_EMAIL, NICK_HELP_REGISTER_EMAIL_REQ);
	setstring(NICK_HELP_UNSET, NICK_HELP_UNSET_REQ_EMAIL);
    }
    if (NSForceNickChange) {
	setstring(DISCONNECT_IN_1_MINUTE, FORCENICKCHANGE_IN_1_MINUTE);
	setstring(DISCONNECT_IN_20_SECONDS, FORCENICKCHANGE_IN_20_SECONDS);
    }

    if (linked)
	introduce_nickserv(NULL);

    return 1;
}




/***********************************************************************************/

static void do_botkill(User *u)
{
NickInfo *ni;
ni = get_nickinfo(u->nick);
    char *nick = strtok(NULL, " ");
    User *u2;
char *sebep;
sebep = strtok_remaining();
 char buf[NICKMAX+32];

if (!is_services_oper(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

 if (!sebep) {
send_cmd(s_NickServ, "NOTICE %s  Sebep girmediniz.", u->nick);
return;
}

  if (!(u2 = get_user(nick))) {
    send_cmd(s_NickServ, "NOTICE %s isleminiz, gerceklestirilmistir.",  u->nick);
return;
}


 if (irc_stricmp(nick, u->nick) == 0) {
 send_cmd(s_NickServ, "NOTICE %s  isleminiz, gerceklestirilemedi.", u->nick);
return;
}

  if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);

            } else if (ni2 == ni) {
            } else {
                ni = ni2;
            }
        }
snprintf(buf, sizeof(buf), "(Reset", u->nick);
        kill_user(s_NickServ, nick, buf);
send_cmd(s_NickServ, "PRIVMSG #Opers 4 %s 12 Botu 4 %s 12 tarafindan 4 %s 12 sebebi ile  killendi.", nick, u->nick, sebep);
}









/***********************************************************************************/


int exit_module(int shutdown_unused)
{
#ifdef CLEAN_COMPILE
    shutdown_unused = shutdown_unused;
#endif

    if (linked)
	send_cmd(s_NickServ, "QUIT :");

    if (old_REGISTER_SYNTAX >= 0) {
	setstring(NICK_REGISTER_SYNTAX, old_REGISTER_SYNTAX);
	old_REGISTER_SYNTAX = -1;
    }
    if (old_HELP_REGISTER_EMAIL >= 0) {
	setstring(NICK_HELP_REGISTER_EMAIL, old_HELP_REGISTER_EMAIL);
	old_HELP_REGISTER_EMAIL = -1;
    }
    if (old_HELP_UNSET >= 0) {
	setstring(NICK_HELP_UNSET, old_HELP_UNSET);
	old_HELP_UNSET = -1;
    }
    if (old_DISCONNECT_IN_1_MINUTE >= 0) {
	setstring(DISCONNECT_IN_1_MINUTE, old_DISCONNECT_IN_1_MINUTE);
	old_DISCONNECT_IN_1_MINUTE = -1;
    }
    if (old_DISCONNECT_IN_20_SECONDS >= 0) {
	setstring(DISCONNECT_IN_20_SECONDS, old_DISCONNECT_IN_20_SECONDS);
	old_DISCONNECT_IN_20_SECONDS = -1;
    }

    if (db_opened)
	close_nick_db(NickDBName);

    exit_util();
    exit_set();
    exit_collide();

    remove_callback(module, "REGISTER/LINK check", do_reglink_check);
    remove_callback(NULL, "user delete", do_user_delete);
    remove_callback(NULL, "user nickchange (after)",
		    do_user_nickchange_after);
    remove_callback(NULL, "user nickchange (before)",
		    do_user_nickchange_before);
    remove_callback(NULL, "user create", do_user_create);
    remove_callback(NULL, "save data", do_save_data);
    remove_callback(NULL, "m_whois", nickserv_whois);
    remove_callback(NULL, "m_privmsg", nickserv);
    remove_callback(NULL, "introduce_user", introduce_nickserv);
    remove_callback(NULL, "reconfigure", do_reconfigure);
    remove_callback(NULL, "command line", do_command_line);

    unregister_callback(module, cb_identified);
    unregister_callback(module, cb_id_check);
    unregister_callback(module, cb_registered);
    unregister_callback(module, cb_reglink_check);
    unregister_callback(module, cb_help_cmds);
    unregister_callback(module, cb_help);
    unregister_callback(module, cb_command);

    /* These are static, so the pointers don't need to be cleared */
    if (cmd_GETPASS)
	cmd_GETPASS->name = "GETPASS";
    if (cmd_DROPEMAIL_CONFIRM)
	cmd_DROPEMAIL_CONFIRM->name = "DROPEMAIL-CONFIRM";
    if (cmd_DROPEMAIL)
	cmd_DROPEMAIL->name = "DROPEMAIL";
    if (cmd_REGISTER)
	cmd_REGISTER->name = "REGISTER";
    unregister_commands(module, cmds);
    del_commandlist(module);

    return 1;
}

/*************************************************************************/


/*************************************************************************/



static void do_kills(User *u) {

NickInfo *ni;
ni = get_nickinfo(u->nick);
    char *nick = strtok(NULL, " ");
    User *u2;
char *sebep;
sebep = strtok_remaining();
      NickGroupInfo *ngi;
 ngi = get_ngi(ni);



  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }


 if (!ngi->helper==1) {
send_cmd(s_NickServ, "NOTICE %s Bu Komuta Erisiminiz Yoktur..", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sadece \2Helperlar\2 Kullanabilir..", u->nick);
return;
}

 if (!sebep) {
send_cmd(s_NickServ, "NOTICE %s  Sebep girmediniz.", u->nick);
return;
}

 if (!(u2 = get_user(nick))) {
 send_cmd(s_NickServ, "NOTICE %s  Kullanici suanda sunucuda yok.", u->nick);
return;
}

 if (irc_stricmp(nick, u->nick) == 0) {
 send_cmd(s_NickServ, "NOTICE %s  isleminiz, gerceklestirilemedi.", u->nick);
return;

} else if (ni->status & NS_GUESTED) {
 send_cmd(s_NickServ, "NOTICE %s  isleminiz, gerceklestirilemedi.", u->nick);
return;
}

        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else {
                ni = ni2;
            }

 send_cmd(s_NickServ, "NOTICE %s Talebiniz, gonderilmistir.", u->nick);
 send_cmd(s_NickServ, "PRIVMSG #Opers 4%s12 Kullanicimiz, 4%s12 kullanicisinin 4%s12 sebepten Banlanmasini istiyor.", u->nick, u2->nick, sebep);

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz;
          dosya_yaz = fopen("kills.txt","a");
if (dosya_yaz != NULL) {
         fprintf(dosya_yaz,"[%s] %s KILLTALEP -> %s Sebep -> %s\n", asctime (timeinfo), u->nick, u2->nick, sebep);
          fclose(dosya_yaz);


}
}
}


/*************************************************************************/



static void do_killist(User *u) {



if (!is_services_admin(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}

char *ibokills = "kills.txt";

char buf[BUFSIZE];

FILE *x = fopen(ibokills, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "NOTICE %s :%s", u->nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}
 
/*************************************************************************/
//Sky Dancer

static void do_alist(User *u) {
	ChannelInfo *ci;
	NickInfo *ni = NULL;
	NickGroupInfo *ngi;
	int32 id;
	int i;
	int liste=0;

	char *nick = strtok(NULL, " ");

	char *snick;

	if (is_oper(u) && nick) {
		snick = nick;
	}
	else {
		snick = u->nick;
	}

	if (!(ni = get_nickinfo(snick))) {
             notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, snick);
	return;
	} else if (ni->status & NS_VERBOTEN) {
              notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, snick);
        return;
	} else if (!user_identified(u)) {
		notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
	return;
	} else if (!(ngi = get_ngi(ni))) {
		notice_lang(s_NickServ, u, INTERNAL_ERROR);
	return;
	}

	if (ni != u->ni)
	    send_cmd(s_NickServ, "NOTICE %s :%s Nickine Ait Erisim Listesi:", u->nick, nick);
	else
	    send_cmd(s_NickServ, "NOTICE %s :Nickinize Ait Erisim Listesi:", u->nick);

    send_cmd(s_NickServ, "NOTICE %s :Kanal  -  Access Seviyesi", u->nick);
strscpy(last_alist_nick, u->nick, NICKMAX);
	for (ci = first_channelinfo(); ci; ci = next_channelinfo()) {

		if (!ci || !valid_ngi(u) || (ci->flags & CI_VERBOTEN) || ci->suspendinfo)
			continue;

		if (ngi->id == ci->founder) {
			send_cmd(s_NickServ, "NOTICE %s :%d. %s - \2founder\2", u->nick, liste+1, ci->name);
			liste++;
		continue;
		}

		id=ngi->id;

	    ARRAY_FOREACH (i, ci->access) {
			if (ci && (ci->access[i].nickgroup == id)) {
			    send_cmd(s_NickServ, "NOTICE %s :%d. %s - Level :\2 %d%s\2", u->nick, liste+1 , ci->name, ci->access[i].level, XOP_LISTNAME(ci->access[i].level));
				liste++;
			continue;
			}
	    }
	}

	if (liste==0) {
		send_cmd(s_NickServ, "NOTICE %s :Kayit bulunamadi.", u->nick);
	}
	else {
		send_cmd(s_NickServ, "NOTICE %s :4 %d 12 adet kayit bulundu.", u->nick, liste);
	}
return;
}




/****************************************************************/


static void do_profil(User *u)
{
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi;

   

/*
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Oncelikle nickinizi kaydetmelisiniz.", u->nick);
return;
}*/

      char *nick = strtok(NULL, " ");
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
                /* Let the command through even for non-servadmins if they
                 * gave their own nick; it's less confusing than a
                 * "Permission denied" error */
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz;
          dosya_yaz = fopen("raporlar.txt","a");
if (dosya_yaz != NULL) {
         fprintf(dosya_yaz,"[%s]  PROFIL -> %s\n", asctime (timeinfo), u->nick);
          fclose(dosya_yaz);


}



  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }
     if ( (ngi->flags & NF_PRIVATE) )
          {
                if
                 (!is_oper(u))
if  (!nick_identified(ni) || (u->ngi != ngi))
                    {
                        send_cmd(s_NickServ, "NOTICE %s Kullanici PROFIL Bilgisini gosterime kapatmis.", u->nick);
                        return;
                    }
          }


   if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
return;
    } else if (!user_identified(u)) {
        notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
return;
    }
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisinin \2PROFIL\2 Bilgileri gosteriliyor..", u->nick, ni->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);

if((ngi->isim!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\212ISIM : 4 %s  ", u->nick, ngi->isim);
}

if((ngi->sehir!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\24%s12 Sehrinde yasiyor. ", u->nick, ngi->sehir);
}
if((ngi->yas!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\24 %s 12 yasinda. ", u->nick, ngi->yas);
}
if((ngi->takim!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s :\24 %s 12 takimini tutuyor. ", u->nick, ngi->takim);
}
if((ngi->burc!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  :\24%s 12 burcunda. ", u->nick, ngi->burc);
}
if((ngi->vhost!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  :\24%s12 Vhostunu kullanmakta.", u->nick, ngi->vhost);
}
if((ngi->iliski!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  :\212Iliski durumu 4%s12 ", u->nick, ngi->iliski);
}


if((ngi->iliskinick!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s  :4%s12 Kullanicisi ile iliski yasiyor. ", u->nick, ngi->iliskinick);
}



if ((ngi->durum!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s \212SWHOIS :  4%s ", u->nick,  ngi->durum);
}
if ((ngi->tweet!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s \2 12TWEET : 4%s ", u->nick,  ngi->tweet);
}
if ((ngi->ident!=NULL)) {
send_cmd(s_NickServ, "NOTICE %s \2 12IDENT : 4%s12", u->nick, ngi->ident);
}
strscpy(last_profil_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s 12Kullanicinin PROFIL Bilgilerini begendiyseniz, 7/NS Begen %s12 yaziniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s  \2PROFIL Sonu..", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s 4%s12 Kullanicisi, 4PROFIL12 Bilgilerinize goz atti.", nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s 4/NS PROFILINFO12 komutundan yardim alarak profil bilgilerinizi tamamlayabilirsiniz.", nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 Kullanicisi \2%s\2 Kullanicisinin profiline bakti.", u->nick, nick);

}


/***********************************************************************************/

static void do_histek(User *u) {

NickInfo *ni;
ni = get_nickinfo(u->nick);
char *sebep;
sebep = strtok_remaining();
      NickGroupInfo *ngi;
 ngi = get_ngi(ni);



  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }


 if (!ngi->helper==1) {
send_cmd(s_NickServ, "NOTICE %s Bu Komuta Erisiminiz Yoktur..", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sadece 4HELPERLAR12 Kullanabilir..", u->nick);
return;
}

 if (!sebep) {
send_cmd(s_NickServ, "NOTICE %s  Sebep girmediniz.", u->nick);
return;
}

send_cmd(s_NickServ, "NOTICE %s  Isteginiz OPERS odasina iletilmistir.", u->nick);
 send_cmd(s_NickServ, "PRIVMSG #Opers \2%s\2 Helperi, istekte bulundu. ISTEK-> \2%s\2", u->nick, sebep);

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz;
          dosya_yaz = fopen("raporlar.txt","a");
if (dosya_yaz != NULL) {
         fprintf(dosya_yaz,"[%s]  HRAPOR -> %s Sebep -> %s\n", asctime (timeinfo), u->nick,  sebep);
          fclose(dosya_yaz);


}
}

/***********************************************************************************/

static void do_komutlar(User *u) {
send_cmd(s_NickServ, "NOTICE %s :\2****************************************************************", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212RuLZzSpecial Eklenti komutlari.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Merhaba, sevgili 4%s", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Sansinizi deneyip hediye kazanmak istiyorsaniz, 4/NS Sans12 Komutunu uygulayiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Servisler üzerindeki bazi istatistikleri gormek istiyorsaniz, 4/Services STATS12 Komutunu uygulayiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12DURUM Belirtmek icin 4/DURUM MESAJ 12Komutununu kullaniniz. Ornek; 4/DURUM Online Degilim!", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Profil bilgileri girip kendinizi daha iyi ifade edebilmek icin, 4/NS Profilinfo12 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Kendinizin veya birbaskasinin profilini gorebilmek icin,4/Profil NICK12 Komutunu uygulayiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Istek,Oneri,Sikayetlerinizi 4/NS istek isteginiz, 4/NS Sikayet sikayetiniz, /NS Oneri oneriniz12 komutlariyla bildirebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Kullanicilarin puanlarini gormek icin 4/Points NICK12 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Bir arkadasinizi durtmek icin, 4/DURT NICK12 Komutunu uygulayiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Vhost secmek icin 4/NS VhostHelp12 komutu ile bilgi alabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Random bir kanala girmek istiyorsaniz 4/NS Kanal12 komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12IRC uzerine tweet atmak icin, 4/TWEET Mesajiniz12 Komutunu uygulayiniz. Ornek-> 4/TWEET Hiç bir şey doğru değil, her şey mümkündür...", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24TWEET, SEHIR, YAS, BURC, TAKIM, DURUM, VHOST12 bilgilerini gormek icin, 4/PROFIL NICK12 Komutunu uygulayiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Bubilgilerin baskasi tarafindan gorulmesini isemiyorsaniz, 4/NS SET PRIVATE ON12 komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Birileriyle tanismak istiyorsaniz, 4/Tanis NICK 12komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Profil komutunu kullanmadan arkadaslarinizin, 4/NS DURUM NICK12 ile durumuna, 4/NS TWEET NICK12 ile tweetlerine bakabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Profiline baktiginiz kisinin Profil bilgilerini, 4/Begen NICK 12Komutu uygulayarak begenebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Hediye gondermek icin, 4/NS HEDIYE HEDIYE NICK12 komutunu kullanmalisiniz. Ornek-> 4/NS HEDIYE CAY %s", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Bu konuda yardim almak icin, 4/NS HEDIYE HELP12 Komutunu kullanabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Hediye markete, 4/Services Market12 komutu ile bakabilirsiniz.", u->nick);
//send_cmd(s_NickServ, "NOTICE %s :\212Hediyeler icin, gonderene 4/NS Tesekkur Nick Tesekkurnedeni12 komutu ile tesekkur gonderebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Isminizi belirtmek icin, 4/NS isim isminiz12 komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Iliski durumunuzu belirtmek icin, 4/NS Set iliski iliskidurumu12 komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Iliskiniz oldugu nicki belirtmek icin, 4/NS Set iliskinick nick12 komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :2Eglenmek, Bomba oyunu oynamak ve nick patlatmak icin, 4/NS Bomba Nick12 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Gollum ile 4KAGIT, TAS, MAKAS12 oyunu oynamak icin, 4/NS GOLLUM HELP12 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :12Identinizi degistirmek icin, 4/ident identiniz12 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\24OPERS12 ve 4HELPER12'larin kullandigi ozel komutlar, listeye konulmamistir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212Kullanilan sistemler, 4toXic12 Tarafindan gelistirilmistir. 12Email :4 ibrahim@klavye.com.tr", u->nick);
send_cmd(s_NickServ, "NOTICE %s :-", u->nick);
send_cmd(s_NickServ, "NOTICE %s :****************************************************************", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 12Kullanicisi 4/Services KOMUTLAR12 Komutunu uyguladi.", u->nick);
}


/*********************************************************************************************/


static void do_durt(User *u)
{
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi;
static int toxolog = 30;
time_t now = time(NULL);
ngi = get_ngi(ni);


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Oncelikle nickinizi kaydetmelisiniz.", u->nick);
return;
}

if (!is_services_root(u) && ngi->lastdurt && now - ngi->lastdurt < toxolog) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu \2( 30 )\2  Saniye icerisinde, sadece \2( 1 )\2 Kez Kullanabilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s Kotu niyetli kullanimda, nickiniz yasaklanabilir.", u->nick);
return;
}

ngi->lastdurt = now;



  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz;
          dosya_yaz = fopen("raporlar.txt","a");
if (dosya_yaz != NULL) {
         fprintf(dosya_yaz,"[%s]  DURT -> %s\n", asctime (timeinfo), u->nick);
          fclose(dosya_yaz);



}



        char *nick = strtok(NULL, " ");
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
                
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }


  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }
                if ( (ngi->flags &  NF_PRIVATE) )
          {
 if
                 (!is_oper(u))
if  (!nick_identified(ni) || (u->ngi != ngi))

                    {

                        send_cmd(s_NickServ, "NOTICE %s Kullanici durtulmek istememektedir.", u->nick);
                        return;
                    }
          }
   if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
return;
    } else if (!user_identified(u)) {
        notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
return;
    }
strscpy(last_durt_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisini durttunuz.", u->nick, nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisini durttunuz.", u->nick, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 Kullanicisi, \2%s\2 Kullanicisini durttu!", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \24%s12 Kullanicisi, sizi 4DURTTU! ", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, sizi \2DURTTU!\2 ", nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 12Sizde 4%s12 Kullanicisini 4Durtmek12 istiyorsaniz, 4/NS DURT %s12 yapiniz.", nick, u->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s Durtulmek istemiyorsaniz, 4/NS SET PRIVATE ON2 Komutunu kullaniniz. Diger komutlar icin, \2/Services Komutlar\2 Komutunu kullaniniz.", nick);

}


/*********************************************************************************************/




static void do_isim(User *u, char *param) {
    NickInfo *ni;
ni = get_nickinfo(u->nick);
    NickGroupInfo *ngi;

char *mesaj;
   //mesaj = strtok(NULL, " ");
   mesaj = strtok_remaining();
/*
if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu ozellik suan adminlere verilmistir.", u->nick);
return;
}*/

   if (!mesaj) {
                send_cmd(s_NickServ, "NOTICE %s :\2Lutfen isim giriniz.", u->nick);
return;
}
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Nickiniz kayitsizdir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Nickinizi kaydedip, tekrar deneyiniz.", u->nick);

return;
}
 if (!(ngi = get_ngi(ni))) {
                notice_lang(s_NickServ, u, INTERNAL_ERROR);
}


if (!param) {
   send_cmd(s_NickServ, "NOTICE %s \2Isminiz  Silinmistir..", u->nick);
return;
} else {
free(ngi->isim);
ngi->isim = sstrdup(mesaj);
  send_cmd(s_NickServ, "NOTICE %s Yazdiginiz isim: %s", u->nick, ngi->isim);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 Kullanicisinin isimi -> 4%s", u->nick, ngi->isim);
put_nickgroupinfo(ngi);
}
}



/************************************************************************/

static void do_tanisaaa(User *u) {

    NickInfo *ni;
ni = get_nickinfo(u->nick);
    NickGroupInfo *ngi;
//ngi = get_ngi(ni);

time_t now = time(NULL);
     static int toxolog = 30;


if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s Bu Komuta Yetkiniz yok..", u->nick);
return;
}






        char *nick = strtok(NULL, " ");
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
               
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }
if (!is_services_root(u) && ngi->lasttanisaaa && now - ngi->lasttanisaaa < toxolog) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu \2( 30 )\2  Saniye icerisinde, sadece \2( 1 )\2 Kez Kullanabilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s Ayni kisiye \2FLOOD yapmak\2, yasaktir.", u->nick);
return;
}


  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
     }
                if ( (ngi->flags & NF_PRIVATE) )
          {
 if
                 (!is_oper(u))
if  (!nick_identified(ni) || (u->ngi != ngi))

                    {

                        send_cmd(s_NickServ, "NOTICE %s Kullanici durtulmek istememektedir.", u->nick);
                        return;
                    }
          }
   if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
return;
    } else if (!user_identified(u)) {
        notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
return;
    }  if (nick) {
send_cmd(s_NickServ, "NOTICE %s Merhaba! \2%s\2 Kullanicisini sizin ile \2tanismak\2 istiyor.", nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisinin \2PROFIL bilgileri\2 ozelinize \2NickServ\2 tarafindan yansitildi..", nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Tanisma istediginiz\2 ve \2profil bilgileriniz\2 gonderilmistir.",  u->nick);
send_cmd(s_NickServ, "PRIVMSG %s -", nick);
send_cmd(s_NickServ, "PRIVMSG %s  \2%s\2 Kullanicisinin \2PROFIL\2 Bilgileri yansitiliyor.", nick);
send_cmd(s_NickServ, "PRIVMSG %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", nick);


if((ngi->sehir!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s :\2%s\2 Sehrinde yasiyor. ", nick, u->ngi->sehir);
}
if((ngi->yas!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s :\2%s\2 yasinda. ", nick, u->ngi->yas);
}
if((ngi->takim!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s :\2%s\2 takimini tutuyor. ", nick, u->ngi->takim);
}
if((ngi->burc!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s  :\2%s\2 burcunda. ", nick, u->ngi->burc);
}

if((ngi->vhost!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s  :\2%s\2 Vhostunu kullanmakta.", nick, u->ngi->vhost);
}
if ((ngi->durum!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s PRIVMSG :  %s ", nick,  u->ngi->durum);
}
if((ngi->tweet!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s  :TWEET: %s", nick, u->ngi->tweet);
}

if((ngi->iliski!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s  :ILISKI DURUMU: %s", nick, u->ngi->iliski);
}
if((ngi->iliskinick!=NULL)) {
send_cmd(s_NickServ, "PRIVMSG %s  :ILISKISI OLDUGU KISI: %s", nick, u->ngi->iliskinick);
}


if(!stricmp("toXic", nick)) {
send_cmd(s_NickServ, "NOTICE %s :\2toXic\2 [ The projects responsible ]", u->nick, nick);
 }

if(!stricmp("toXic", u->nick)) {
send_cmd(s_NickServ, "PRIVMSG %s -", nick);
send_cmd(s_NickServ, "PRIVMSG %s :\2RuLZzServices Yapimcisi, Sistemler sorumlusu, Gelistirici, Sunucu yoneticisidir.",
        nick);
send_cmd(s_NickServ, "PRIVMSG %s -", nick);
}

strscpy(last_tanis_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "PRIVMSG %s  Gorusmeyi kabul ediyorsaniz, \2/query %s\2 komutunu uygulayip ozel acabilirsiniz..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", nick);
send_cmd(s_NickServ, "PRIVMSG %s -", nick);
} 

   
}


/*********************************************************************************************/


static void do_begen(User *u)
{
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi;
static int toxolog = 30;
time_t now = time(NULL);
ngi = get_ngi(ni);
        char *nick = strtok(NULL, " ");


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Oncelikle nickinizi kaydetmelisiniz.", u->nick);
return;
}


if (!is_services_admin(u) && ngi->lastbegen && now - ngi->lastbegen < toxolog) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu \2( 30 )\2  Saniye icerisinde, sadece \2( 1 )\2 Kez Kullanabilirsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s Kotu niyetli kullanimda, nickiniz yasaklanabilir.", u->nick);
return;
}
ngi->lastbegen = now;



  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }

     if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
                /* Let the command through even for non-servadmins if they
                 * gave their own nick; it's less confusing than 
                 * "Permission denied" error */
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }


else if (nick){


  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }
                if ( (ngi->flags & NF_PRIVATE) )
          {
 if
                 (!is_oper(u))
if  (!nick_identified(ni) || (u->ngi != ngi))

                    {

                        send_cmd(s_NickServ, "NOTICE %s Kullanici Bu komutun kullanilmasini istememektedir.", u->nick);
                        return;
                    }
          }
   if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
return;
    } else if (!user_identified(u)) {
        notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
return;
    }
strscpy(last_begen_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisinin \2PROFIL bilgilerini\2 begendiniz.", u->nick, nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 Kullanicisi, 4%s2 Kullanicisinin 4PROFIL2 Bilgilerini begendi!", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2 4%s12 Kullanicisi, PROFILINIZI 12Begendi! ", nick, u->nick);

        }

}

/***********************************************************************************/

static void do_stats(User *u)
{
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s -\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, bir baskasinin 4PROFIL Bilgilerini12 begenmis.", u->nick, last_begen_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, bir baskasinin 4PROFIL Bilgilerine12 goz atmis.", u->nick, last_profil_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, bir baskasina 4Tanisma istegi12 yollamis!", u->nick, last_tanis_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, bir baskasini 4Durtmus!", u->nick, last_durt_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, bir baskasinin 4TWEET12ine bakmis.", u->nick, last_tweet_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, bir baskasinin 4Durumuna12 bakmis.", u->nick, last_durum_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, nickini 4IDENTIFY12 etmis.!", u->nick, last_identify_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4SANS12 Komutunu uygulamis.", u->nick, last_sans_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4POINTS12 Komutunu uygulamis.", u->nick, last_points_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4VHOST Listesine12 goz atmis.", u->nick, last_vhostlist_nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4Yetkilerine (ALIST)12 goz atmis..", u->nick, last_alist_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4/NS INFO NICK12 Komutunu kullanmis.", u->nick, last_info_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4VHOST12 secmis.", u->nick, last_vhost_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4YAS12 Secenegini doldurmus.", u->nick, last_yas_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4SEHIR12 Secenegini doldurmus.", u->nick, last_sehir_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4TAKIM12 Secenegini doldurmus.", u->nick, last_takim_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4BURC12 Secenegini doldurmus.", u->nick, last_burc_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4SWHOIS12 Eklemis.", u->nick, last_durum_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4TWEET12 atmis.", u->nick, last_tweet_nick); 
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, Nickini 4DROP12LAMIS.", u->nick, last_drop_nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kanali 4kaydedilmis", u->nick, last_register_chan);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kanalina 4INFO12 Komutu uygulanmis.", u->nick, last_info_chan);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kanalina 4TOPIC12 Atilmis.", u->nick, last_cstopic_chan);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kanali 4IDENTIFY12 edilmis.", u->nick, last_identify_chan);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, Bir baskasina 4MEMO12 gondermis.", u->nick, last_memo_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4AJOIN12 eklemis.", u->nick, last_ajoin_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4Nickini linklemis.", u->nick, last_link_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4/Services Stats12 Komunu kullanmis.", u->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 Kullanicisi \2/Services STATS\2 Komutunu uyguladi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s -\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

}



static void do_toxic(User *u)
{

NickGroupInfo *ngi;
NickInfo *ni;
ni = get_nickinfo(u->nick);
time_t now = time(NULL);
ni = get_nickinfo(u->nick);
ngi = get_ngi(ni);

char *sebep;
sebep = strtok_remaining();


  
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s :Misafir olarak \2toXic bey\2 ile gorusme talep edemezsiniz.", u->nick);
return;
}


if (!sebep) {
send_cmd(s_NickServ, "NOTICE %s Lutfen, gorusme nedeninizi giriniz.", u->nick);
return;
}


if (!ngi) {
send_cmd(s_NickServ, "NOTICE %s :iç hata oluştu.", u->nick);
return;
}


if (!is_services_root(u) && ngi->lasttoxic && now - ngi->lasttoxic < 30) {
send_cmd(s_NickServ, "NOTICE %s :Lutfen, daha fazla israrci olmayiniz.", u->nick);
return;
}

ngi->lasttoxic = now;


send_cmd(s_NickServ, "NOTICE %s \2 7Sayin 12toXic7 ile görüşme icin kendisine haber iletilecektir.",  u->nick);
send_cmd(s_NickServ, "NOTICE %s Kendisi yogun olabilir, lutfen sabir ile bekleyiniz.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog %s kullanicisi toXic ile gorusme talep etmektedir.", u->nick);
send_cmd(s_NickServ, "PRIVMSG toXic \2%s\2 Kullanicisi  \2%s\2 sebebi ile sizin ile gorus talep etmektedir.", u->nick, sebep);
return;
}


/*************************************************************************/

//toXic


static void do_hediye(User *u)
{

   const char *cmd;
 cmd = strtok(NULL, " ");
    if (!cmd)
        cmd = "";
char *nick;
  nick = strtok(NULL, " ");
  NickGroupInfo *ngi;
  NickInfo *ni;
ni = get_nickinfo(u->nick);
time_t now = time(NULL);
static int toxolog = 30;
/*
if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}
*/


if (stricmp(cmd, "STATS") == 0) {
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4SARAP12 gondermis", u->nick, last_sarap_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4HAMBURGER12 gondermis", u->nick, last_hamburger_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4VISKI12 gondermis", u->nick, last_viski_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4PASTA12 gondermis", u->nick, last_pasta_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4KAHVE12 gondermis", u->nick, last_kahve_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4OPUCUK12 gondermis", u->nick, last_opucuk_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4TOKAT12 atmis.", u->nick, last_tokat_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4RAKI12 gondermis", u->nick, last_raki_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4CAY12 gondermis", u->nick, last_cay_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4BIRA12 gondermis", u->nick, last_bira_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4SAYDEK12 gondermis", u->nick, last_saydek_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4REDBULL12 gondermis", u->nick, last_redbull_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4PIZZA12 gondermis", u->nick, last_pizza_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4EMZIK12 gondermis", u->nick, last_emzik_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4KOLA12 gondermis", u->nick, last_kola_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4SIGARA12 gondermis", u->nick, last_sigara_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4TEKILA12 gondermis", u->nick, last_tekila_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4TEKME12 atmis", u->nick, last_tekme_nick);
send_cmd(s_NickServ, "NOTICE %s :\212En son 4%s12 Kullanicisi, 4YUMRUK12 atmis", u->nick, last_yumruk_nick);
send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4KAFA12 atmis", u->nick, last_kafa_nick);
//send_cmd(s_NickServ, "NOTICE %s :12En son 4%s12 Kullanicisi, 4TESEKKUR12 etmis", u->nick, last_tesekkur_nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 kullanicisi /NS HEDIYE STATS\2 komutunu uyguladi.", u->nick); 
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
return;
}

if (stricmp(cmd, "HELP") == 0) {
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s Kazandiginiz puanlara gore arkadaslariniza hediyeler gonderebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Hediye listesine 4/Services MARKET12 komutunu kullanarak bakabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Hediye gonderdiginiz zaman puanlariniz yerinde kalir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Paraniz ne kadar yuksekse, o kadar buyuk hediyeler gonderebilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Paranizi gormek icin 4/NS Points %s12 komutunu kullanmalisiniz.", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s Hediye gonderimlerinizi ancak 4 3012 saniyede yalnizca 4 1 12 kez yapabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Cay ve Saydek urunumuzun gonderimi icin paraya ihtiyac yoktur.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Kayitsiz nicklere hediye gonderemezsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Eger hediye almak istemiyorsaniz; 4/NS SET PRIVATE OFF 12komutu ile kapatabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Komut kullanimi: 4/NS Hediye URUN NICK", u->nick);
send_cmd(s_NickServ, "NOTICE %s 12Ornek kullim: 4/NS HEDIYE CAY %s", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s Hediye istatistiklerini gormek icin, 4/NS HEDIYE STATS12 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s12 kullanicisi 4/NS HEDIYE HELP12 komutunu uyguladi.", u->nick);
return;
}


if (!nick) {
send_cmd(s_NickServ, "NOTICE %s Eksik/Hatali bir giris yaptiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Ayrintili bilgi icin kutfen, 4/NS HEDIYE HELP2 komutunu kullaniniz.", u->nick);
return;
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 kullanicisi 4/NS HEDIYE 2 komutunu eksik uyguladi.", u->nick);
}

time_t zaman;
struct tm * timeinfo;
time ( &zaman );
timeinfo = localtime ( &zaman );
FILE *dosya_yaz = fopen("raporlar.txt","a");
if (dosya_yaz != NULL) {
  fprintf(dosya_yaz,"[%s] %s  HEDIYE \n", asctime (timeinfo),  u->nick);
  fprintf(dosya_yaz,"-----------------------\n");
  fclose(dosya_yaz);
}



  if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }



  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }

 if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
return;
}


 if (!(ni = get_nickinfo(nick))) {
        notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
return;
}


 if(!stricmp("toXic", nick)) {
send_cmd(s_NickServ, "NOTICE %s 1toXic Hediye almaktan ve hediye vermekten hoslanmaz.", u->nick);
return;
}


if (!ngi) {
send_cmd(s_NickServ, "NOTICE %s :Bir hata olustu.", u->nick);
return;
}
/*
 if (!ngi->hediye==1) {
send_cmd(s_NickServ, "NOTICE %s Kullanici hediye almak istememektedir.", u->nick);
return;
}*/

if (!is_services_root(u) && ngi->lasthediye && now - ngi->lasthediye < toxolog) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu \2( 30 ) \2 saniyede, sadece \2 1 \2 Kez Kullanabilirsiniz..", u->nick);
return;
}

ngi->lasthediye = now;




if (stricmp(cmd, "SARAP") == 0) {
static int birap =  60*60*24*6;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(12)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_sarap_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2SARAP\2 Gonderildi.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 size \2SARAP\2 Gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 size \2SARAP\2 Gonderdi. (Laf aramizda yaninda HIYARDA Gondermis.)", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4SARAP2 gonderdi. HIYARI ile birlikte gondermis ama.", u->nick, nick);
}

else if (stricmp(cmd, "Hamburger") == 0) {
static int birap =  60*60*24*2;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(4)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_hamburger_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2HAMBURGER\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2HAMBURGER\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2HAMBURGER\2 gonderdi. Bu iste bir is olabilir.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4HAMBURGER2 gonderdi.", u->nick, nick);
 }


else if  (stricmp(cmd, "VISKI") == 0) {
static int birap =  60*60*24*15;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(45)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 3));
    return;
}
strscpy(last_viski_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2VISKI\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2VISKI\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2VISKI\2 gonderdi. Yaninada bi cikolata alirsin artik.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4VISKI2 gonderdi.", u->nick, nick);
 }

else if  (stricmp(cmd, "PASTA") == 0) {
static int birap =  60*60*24*1;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(2)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_pasta_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2PASTA\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2PASTA\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2PASTA\2 gonderdi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4PASTA2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "KAHVE") == 0) {
static int birap =  60*60*24*1;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(2)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}

strscpy(last_kahve_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2KAHVE\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2KAHVE\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size simsicacik \2KAHVE\2 gonderdi. Ona tesekkur etmelisin.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4KAHVE2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "OPUCUK") == 0) {
static int birap =  60*60*24*1;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(2)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_opucuk_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2OPUCUK\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2OPUCUK\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2OPUCUK\2 gonderdi. Begenmediysen ona tokat at.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4OPUCUK2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "TOKAT") == 0) {
static int birap =  60*60*24*1;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(2)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_tokat_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2TOKAT\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2TOKAT\2 atti.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2TOKAT\2 atti. Sende ona tekme at dostum.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4TOKAT2 atti..", u->nick, nick);
}

else if  (stricmp(cmd, "RAKI") == 0) {
static int birap =  60*60*24*15;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(45)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 3));
    return;

}
strscpy(last_raki_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2RAKI\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2RAKI\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2RAKI\2 gonderdi. Yaninda kavun ve beyaz peynirde bulunmaktadir.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4RAKI2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "CAY") == 0) {
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2CAY\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2CAY\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2CAY\2 gonderdi. \2Afiyet olsun.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4CAY2 gonderdi.", u->nick, nick);
strscpy(last_cay_nick, u->nick, NICKMAX);
}



else if  (stricmp(cmd, "BIRA") == 0) {
static int birap =  60*60*24*1;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(3)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 3));
    return;
}
strscpy(last_bira_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2BIRA\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2BIRA\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2BIRA\2 gonderdi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4BIRA2 gonderdi.", u->nick, nick);
}



else if  (stricmp(cmd, "REDBULL") == 0) {
static int birap =  60*60*24*8;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(16)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_redbull_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2RED BULL\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2RED BULL\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2RED BULL\2 gonderdi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4REDBULL2 gonderdi.", u->nick, nick);
}


else if  (stricmp(cmd, "PIZZA") == 0) {
static int birap =  60*60*24*5;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(10)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;

}
strscpy(last_pizza_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2PIZZA\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2PIZZA\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2PIZZA\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4PIZZA2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "EMZIK") == 0) {
static int birap =  60*60*24*12;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(36)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 3));
    return;
}
strscpy(last_emzik_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2EMZIK\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2EMZIK\2 gonderdi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2EMZIK\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4EMZIK2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "SAYDEK") == 0) {
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2SAYDEK\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2SA SA SAYDEK\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2SA SA SAYDEK\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  \2%s\2 Kullanicisi, \2%s\2 Kullanicisina \2SAYDEK\2 gonderdi.", u->nick, nick);
strscpy(last_saydek_nick, u->nick, NICKMAX);
}

else if  (stricmp(cmd, "KOLA") == 0) {
static int birap =  60*60*24*1;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(2)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_kola_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2KOLA\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2KOLA\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, size \2KOLA\2 ismarladi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4KOLA2 gonderdi.", u->nick, nick);
}


else if  (stricmp(cmd, "SIGARA") == 0) {
static int birap =  60*60*24*2;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(4)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;

}
strscpy(last_sigara_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2SIGARA\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2SIGARA\2 gonderdi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, size \2SIGARA\2 gonderdi. (SAMSUN 216)", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4SIGARA2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "TEKME") == 0) {
static int birap =  60*60*24*2;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(4)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_tekme_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2TEKME\2 attiniz. Yumrugunuzu bekleyiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2TEKME\2 atti.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, Narin buyuk kiciniza kocaman bi \2TEKME\2  salladi. (Sende ona yumruk at.)", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4TEKME2 atti.", u->nick, nick);
}

else if  (stricmp(cmd, "YUMRUK") == 0) {
static int birap =  60*60*24*3;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(6)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
strscpy(last_yumruk_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2YUMRUK\2 attiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2YUMRUK\2 atti.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, kasinizin kuzeybati kismina bakan dilimine yumruk salladi. (SENDE ONA KAFA AT)", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4YUMRUK2 atti.", u->nick, nick);
}


else if  (stricmp(cmd, "ORALET") == 0) {
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2ORALET\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2ORALET\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2ORALET\2 gonderdi. \2Afiyet olsun.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4ORALET2 gonderdi.", u->nick, nick);
}

else if  (stricmp(cmd, "SU") == 0) {
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2SU\2 gonderdiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2  Kullanicisi, size \2SU\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2  Kullanicisi, size \2SU\2 gonderdi. \2Afiyet olsun.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4SU2 gonderdi.", u->nick, nick);
}

 else if  (stricmp(cmd, "CACIK") == 0) {
static int birap =  60*60*24*4;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(8)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2CACIK\2 Yolladiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2CACIK\2 Yolladi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, Size cacik yolladi. Hiyar olarakda kendini koyarsin dedi. ", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4CACIK2 Yolladi.", u->nick, nick);
}
 else if  (stricmp(cmd, "MADENSUYU") == 0) {
static int birap =  60*60*24*4;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(8)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2MADENSUYU\2 Yolladiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2MADENSUYU\2 Yolladi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, Size MADENSUYU yolladi. Hiyar olarakda kendini koyarsin dedi. ", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina \2MADENSUYU\2 Yolladi.", u->nick, nick);
}



else if  (stricmp(cmd, "CIKOLATA") == 0) {
static int birap =  60*60*24*3;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(6)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2CIKOLATA\2 yolladiniz..", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2CIKOLATA\2 Yolladi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, size \2 CIKOLATA\2 Yolladi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina \2CIKOLATA\2 Yolladi..", u->nick, nick);
}

 

 else if  (stricmp(cmd, "CORBA") == 0) {
static int birap =  60*60*24*4;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(8)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2CORBA\2 Yolladiniz.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2CORBA\2 Yolladi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, Size CORBA yolladi. ", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4CORBA2 Yolladi.", u->nick, nick);
}



else if  (stricmp(cmd, "BEBEK") == 0) {
static int birap =  60*60*24*3;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(6)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2BEBEK\2 yolladiniz..", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2BEBEK\2 Yolladi..", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, Size \2BEBEK\2 Yolladi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina \2BEBEK\2 Yolladi..", u->nick, nick);
}



else if  (stricmp(cmd, "KAFA") == 0) {
static int birap =  60*60*24*4;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(8)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}


strscpy(last_kafa_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2KAFA\2 attiniz. (Yere yigildi.)", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s 4%s2 Kullanicisi, size 4KAFA2 atti.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s 4%s2 Kullanicisi, kafaniza 4KAFA2 atti. Sizin kafa curuk cikti patladi. (En iyisi ona opucuk gonderip barisin)", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina \2KAFA\2 atti.", u->nick, nick);
}

else if  (stricmp(cmd, "TEKILA") == 0) {
static int birap =  60*60*24*15;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(45)\2 Olmalidir. Lutfen puaniniz kadar konusun.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;


}
strscpy(last_tekila_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2TEKILA\2 gonderdi.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2TEKILA\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, size \2TEKILA\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4TEKILA2 gonderdi..", u->nick, nick);
}
else if  (stricmp(cmd, "CICEK") == 0) {
static int birap =  60*60*24*15;
if (!is_services_admin(u) &&   ni->toplamzaman  <= birap) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(45)\2 Olmalidir. Lutfen puaniniz kadar konusun.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;


}

send_cmd(s_NickServ, "NOTICE %s %s Kullanicisina \2CICEK\2 gonderdi.", u->nick, nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisi, size \2CICEK\2 ismarliyor.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi, size \2CICEK\2 gonderdi.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog  4%s2 Kullanicisi, 4%s2 Kullanicisina 4CICEK2 gonderdi..", u->nick, nick);
}





}

/*******************************************************************************************/

static void do_market(User *u)
{
send_cmd(s_NickServ, "NOTICE %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s Merhaba \2%s\2, Hediye market'e hos geldiniz.", u->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s Assagidaki urunlerimizi Paraniz dahilinde kullanabilirsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Ayrintili bilgi icin \2/NS HEDIYE HELP\2 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : SU 4(BEDAVA)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : CAY 4(BEDAVA)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : ORALET 4(BEDAVA)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : SAYDEK 4(BEDAVA)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : KOLA 4(2 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : BIRA 4(2 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : OPUCUK 4(2 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : TOKAT 4(2 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : KAHVE 4(2 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : PASTA 4(2 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : SIGARA 4(4 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : TEKME 4(4 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : YUMRUK 4(6 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : BEBEK 4(6 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : CIKOLATA 4(6 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : KAFA 4(8 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : CORBA 4(8 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : CACIK 4(8 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : MADENSUYU 4(8 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : PIZZA 4(10 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : SARAP 4(12 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : REDBULL 4(16 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : EMZIK 4(36 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : RAKI 4(45 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : VISKI 4(45 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2 --12 : TEKILA 4(45 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s  --12 : CICEK 4(45 PUAN)", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 kullanicisi /NS MARKET\2 komutunu uyguladi.", u->nick);
}


/***************************************************************************************/


static void do_tesekkuraaa(User *u)
{

char *nick;
  nick = strtok(NULL, " ");
char *reason;
   reason = strtok_remaining();

NickInfo *ni;
ni = get_nickinfo(u->nick);

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Once Nickinizi kayit etmelisiniz.", u->nick);
return;
}
 

if (!reason) {
send_cmd(s_NickServ, "NOTICE %s  Lutfen neden tesekkur etmek istediginizi yaziniz.", u->nick);
return;
}


if (!nick) {
 send_cmd(s_NickServ, "NOTICE %s  Eksik/Hatali bir giris yaptiniz.", u->nick);
return;
}

  if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }


strscpy(last_tesekkur_nick, u->nick, NICKMAX);
send_cmd(s_NickServ, "NOTICE %s Tesekkurunuz gonderilmistir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Size \2TESEKKUR\2 etti.", nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Kullanicisi size \2%s\2 nedenle tesekkur etti.",  nick, u->nick, reason);
send_cmd(s_NickServ, "PRIVMSG #operlog %s Kullanicisi \2%s\2 Kullanicisina \2%s\2 nedenle tesekkurde bulundu.", u->nick, nick);
  }


/********************************************************************************************************************/

static void do_iliskiler(User *u)
{


NickInfo *ni;
ni = get_nickinfo(u->nick);


  char *iliskiListesi[8]={
"Yok", "Var", "Nisanli", "Evli", "Karmasik",
"Serbest", "Dul", "Bosanmis",

};

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s  Nick Kaydetmeden Bu komutu \2 Kullanamazsiniz..", u->nick);
send_cmd(s_NickServ, "NOTICE %s Ayrintili Bilgi icin\2 #HELP \2 Kanalini Kullaniniz.", u->nick);
return;
}

send_cmd(s_NickServ, "NOTICE %s Kullanilabilir \2ILISKI\2 Secenekleri Listemiz", u->nick);
send_cmd(s_NickServ, "NOTICE %s ****************************", u->nick);
send_cmd(s_NickServ, "NOTICE %s -", u->nick);


int i;
int size = 8;
for (i=0; i<size; i++)
send_cmd(s_NickServ, "NOTICE %s   \2(%d\2) Numara ->  \2%s", u->nick,  i+1,  iliskiListesi[i]);
}

/**************************************************************************************************/

static void do_cicek(User *u)
{
    NickInfo *ni = u->ni;
    NickGroupInfo *ngi;
static int csure =  60*60*24*1;
static int toxolog = 60;

time_t now = time(NULL);


if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Oncelikle nickinizi kaydetmelisiniz.", u->nick);
return;
}


if (!is_services_root(u) &&   ni->toplamzaman  <= csure) {
  notice_lang(s_NickServ, u, PERMISSION_DENIED);
send_cmd(s_NickServ, "NOTICE %s Bu Komutu Kullanmak icin paraniz \2(2)\2 Olmalidir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Sizin paraniz \2%d\2",  u->nick, (ni->toplamzaman / 86400 * 2));
    return;
}

 

    char *nick = strtok(NULL, " ");
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                //notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                //return;
            } else if (ni2 == ni) {
                /* Let the command through even for non-servadmins if they
                 * gave their own nick; it's less confusing than a
                 * "Permission denied" error */
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }



if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }

if (!nick) {
send_cmd(s_NickServ, "NOTICE %s  Hatali Kullanim.", u->nick);
}

if (!is_services_root(u) && ngi->lastcicek && now - ngi->lastcicek < toxolog) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu \2( 1 ) \2 dakikada, sadece \2 1 \2 Kez Kullanabilirsiniz..", u->nick);
return;
}

ngi->lastcicek = now;



send_cmd(s_NickServ, "NOTICE %s \2%s\2 Kullanicisina cicek takdim ediliyor.", u->nick, nick);
send_cmd(s_NickServ, "PRIVMSG %s 4Merhaba Sevgili 2%s4 Bunlar 2%s4 Tarafindan size takdim ediliyor.", nick, nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s  \2", nick);
send_cmd(s_NickServ, "PRIVMSG %s  \2", nick);
char *ibokuks = "tcicek.txt";

char buf[BUFSIZE];
send_cmd(s_NickServ, "PRIVMSG %s \2", nick);
FILE *x = fopen(ibokuks, "r");
if (x) {
while (fgets(buf, sizeof(buf), x)) {
buf[strlen(buf)-1] = 0;
send_cmd(s_NickServ, "PRIVMSG %s :%s",nick, buf);
}
fclose(x);
} else {
send_cmd(s_NickServ, "NOTICE %s :Henuz bir kayit yok.", u->nick);
}
}

/***************************************************************/

static void do_bomba(User *u)
{
    NickInfo *ni = u->ni;
static int toxolog = 60;
time_t now = time(NULL);
NickGroupInfo *ngi;
ngi = get_ngi(ni);



if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Oncelikle nickinizi kaydetmelisiniz.", u->nick);
return;
}


        char *nick = strtok(NULL, " ");
        if (nick) {
            NickInfo *ni2 = get_nickinfo(nick);
            if (!ni2) {
                notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
                return;
            } else if (ni2 == ni) {
            } else if (!ni) {
                notice_lang(s_NickServ, u, PERMISSION_DENIED);
                return;
            } else {
                ni = ni2;
            }
        }

if (!nick) {
send_cmd(s_NickServ, "NOTICE %s Kullanim; \2/NS Bomba NICK\2", u->nick);
return;
}


   if (ni->status & NS_VERBOTEN) {
        notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, ni->nick);
return;
    } else if (!user_identified(u)) {
        notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
return;
    }

if(!stricmp("toXic", ni->nick)) {
send_cmd(s_NickServ, "NOTICE %s 4Yuce toXic efendimize1 yaptiginiz suikast girisimi engellenmistir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 kullanicisinin size yaptigi suikast girisimi basariyla engellenmistir.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 5%s7 Kod adli teroristin 5Yuce toXic efendimize7 suikast girisimi basariyla engellenmistir.", u->nick);
return;
}


if (nick_is_services_oper(ni))  {
send_cmd(s_NickServ, "NOTICE %s toXic Operleri koruma altina almistir.", u->nick);
return;
}

if (!is_services_root(u) && ngi->lastbomba && now - ngi->lastbomba < toxolog) {
send_cmd(s_NickServ, "NOTICE %s Bu Komutu  \2( 1 )\2 dakika icerisinde, sadece \2 1 \2 Kez Kullanabilirsiniz..", u->nick);
return;
}  else  if (irc_stricmp(nick, u->nick) == 0) {
send_cmd(s_NickServ, "NOTICE %s  Kendinizi bombalayamazsiniz.", u->nick);
return;
}

       if ( (ngi->flags & NF_PRIVATE) )
          {
 if
                 (!is_oper(u))

                    {
                         send_cmd(s_NickServ, "NOTICE %s :%s2 Kendinizi korumaya alarak baskasini bombalayamazsiniz.", u->nick, ni->nick);

                        return;
                    }
          }


User *u2;
 if (!(u2 = get_user(nick))) {
 send_cmd(s_NickServ, "NOTICE %s  Kullanici suanda sunucuda yok.", u->nick);
return;
}


         if ( (u2->ngi->flags & NF_PRIVATE) )
          {
 if
                 (!is_oper(u2))
if  (!nick_identified(ni) || (u2->ngi != ngi))

                    {
 if(stricmp("toXic", u->nick)) {
 
                       send_cmd(s_NickServ, "NOTICE %s :4%s12 Kullanicisi, Kendisini 4Bombaya12'ya kapatmistir.", u->nick, ni->nick);
                        return;
                    }
}
}

ngi->lastbomba = now;

int x = 0;
int ibo = 0;
  for (ibo = 0; ibo < 1; ++ibo)
        x=rand()%8;
if (x == 0) {
send_cmd(s_NickServ, "NOTICE %s  \2%s\2 Nickini \2havaya\2 ucurdunuz.", u->nick, ni->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Nicki size \2bomba\2 atti ve \2havaya ucurdu.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Nicki size \2bomba\2 atti ve \2havaya ucurdu.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 arkadasimiz 4%s2 kardesimize bomba atti ve hedefi tutturdu.", u->nick, ni->nick);
send_nickchange_remote(ni->nick, make_guest_nick());
} else if (x == 1) {
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Nicki size \2bomba\2 atti fakat \2tutturamadi.", ni->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Iskaladin, hadi ama dostum yapabilirsin.", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Nicki size \2bomba\2 atti fakat \2tutturamadi.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 dostumuz 4%s2 dostumuza bomba atti ama tutturamadi :)", u->nick, ni->nick);
} else if (x == 2) {
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Nicki size \2bomba\2 atti beceriksizliginden\2 iskaladi.", ni->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Iskaladin, cok beceriksizsin dostum..", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Nicki size \2bomba\2 atti beceriksizliginden\2 iskaladi.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 bombayi 4%s2 kardesimizi iskaladi.", u->nick, ni->nick);
} else if (x == 3) {
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Nicki size \2bomba\2 atti fakat \2tutturamadi.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Nicki size \2bomba\2 atti fakat \2tutturamadi.", ni->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Iskaladiniz.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 arkadasimiz 4%s2 arkadasimizi vurmak isterken bomba atmasini ogrenemedi yine iskaladi..",
u->nick,ni->nick);
} else if (x == 4) {
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Nicki size \2bomba\2 atti ama \2kendi patladi.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Nicki size \2bomba\2 atti ama \2kendi patladi.", ni->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Kendini patlattin.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 arkadasimiz 4%s2 ye atmak isterken is kazasi yapti ve bombayla kendini patlatti.", u->nick, ni->nick);
} else if (x == 5) {
send_cmd(s_NickServ, "NOTICE %s \2%s\2 Nicki size \2bomba\2 atti kendi adamini vurdu salak.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 Nicki size \2bomba\2 atti kendi adamini vurdu salak.", ni->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Kendi adamini vurdun.", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 bombayi kendi arkadasina atti.", u->nick);

}  else if (x == 6) {
send_cmd(s_NickServ, "NOTICE %s Bomba elinizde patladi.", u->nick);
send_cmd(s_NickServ, "PRIVMSG %s \2%s\2 size bomba atmak istedi elinde patladi. Ispiyonlayalim dedik.", ni->nick, u->nick);
send_cmd(s_NickServ, "NOTICE %s \2%s\2 size bomba atmak istedi elinde patladi. Ispiyonlayalim dedik.", ni->nick, u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 arkadasimiz \2%s\2 kardesimize bomba atmak istedi, kendi elinde patladi.", u->nick, ni->nick);
send_nickchange_remote(u->nick, make_guest_nick());

}  else if (x == 7) {
send_cmd(s_NickServ, "NOTICE %s Siz en iyisi birdaha deneyin.", u->nick);
}
}



/***********************************************************************************************************************/

static void do_gollum(User *u)
{

   const char *cmd;
 cmd = strtok(NULL, " ");
    if (!cmd)
        cmd = "";
//char *nick;
//  nick = strtok(NULL, " ");
  NickGroupInfo *ngi;
  NickInfo *ni;
ni = get_nickinfo(u->nick);
time_t now = time(NULL);
static int toxolog = 5;
/*
if (!is_services_root(u)) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komuta Yetkiniz yok..", u->nick);
return;
}
*/

if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Bu oyunu oynamaniz icin nickinizi kaydetmelisiniz.", u->nick);
return;
}


   
send_cmd(s_NickServ, "NOTICE %s Ayrintili bilgi icin, \2/NS GOLLUM HELP\2 Komutunu kullaniniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);

if (stricmp(cmd, "HELP") == 0) {
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s Bu oyunumuzda Golluma karsi savasicaksiniz ve 3 secenege sahipsiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Kagit, Makas ve Tas.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2Ornek komut kullanimi /NS GOLLUM Kagit\2 seklindedir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2TAS :\2 Makasi alir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2MAKAS :\2 Kagidi alir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2KAGIT :\2 Tasi alir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Not:\2 toXic hep kazanir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog \2%s\2 kullanicisi \2GOLLUM HELP\2 Komutunu kullandi.", u->nick);
return;
}

  if (!(ngi = get_ngi(ni))) {
        notice_lang(s_NickServ, u, INTERNAL_ERROR);
return;
    }

if (!is_services_root(u) && ngi->lastgollum && now - ngi->lastgollum < toxolog) {
send_cmd(s_NickServ, "NOTICE %s :Bu Komutu \2( 5 ) \2 saniyede, sadece \2 1 \2 Kez Kullanabilirsiniz..", u->nick);
return;
}

ngi->lastgollum = now;

if (stricmp(cmd, "KAGIT") == 0) {
int x = 0;
int ibo = 0;
  for (ibo = 0; ibo < 3; ++ibo)
        x=rand()%3;
if (x == 0) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2Kagit\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2Makas", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 Makas ile kagidinizi kesti.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 My precioussss! Oyun mu! Bis oyunları pek severis kıymetlimiss?", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimiss \2Kagit\2 secerek, \2Makas\2 secen Gollum'a kaybetti.", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

} else if (x == 1) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2Kagit\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2TAS", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Kagit\2 ile Gollum'un \2TAS\2ini kapladiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 Kiymayin bana kiymetlimissssss", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimiss \2Kagit\2 ile \2Gollum\2un tasini kapladi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
} else if (x == 2) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2Kagit\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2KAGIT", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 ile berabere kaldiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 Kutsa bisi, ısla bisi kıymetlimiss. Tam ağısımısa layık.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimisss \2Kagit\2 secerek gollum ile pisti oldu", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

    return;
}
}

else if (stricmp(cmd, "MAKAS") == 0) {
int x = 0;
int ibo = 0;
  for (ibo = 0; ibo < 3; ++ibo)
        x=rand()%3;
if (x == 0) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2TAS\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2Kagit", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 Kagit ile makasinizi kapladi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 -Oyun mu! Bis oyunları pek severis kıymetlimiss? Oyunları sevmes misin? ", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimisss \2TAS\2 secerek Gollumun kagidina karsi kaybetti. ", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
} else if (x == 1) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2MAKAS\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2TAS", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum bey\2'in tasini kirdiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 sssssssssssssss", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimiss \2MAKAS\2 secerek, Gollumun tasini kirdi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

} else if (x == 2) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2MAKAS\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2MAKAS", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 ile berabere kaldiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 Kutsa bisi, ısla bisi kıymetlimiss. Tam ağısımısa layık.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimisss \2MAKAS\2 ile \2Gollum\2 beyle berabere kaldi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

    return;
}
}
else if (stricmp(cmd, "TAS") == 0) {
int x = 0;
int ibo = 0;
  for (ibo = 0; ibo < 3; ++ibo)
        x=rand()%3;
if (x == 0) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2TAS\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 Hazretlerinin secimi -> \2Kagit", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2un kagidi tasinizi kapatti! Gollum affetmez, mahfeder.", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimisss \2TAS\2 secerek, \2Gollum\2un kagidina kaybetti.", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

} else if (x == 1) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2TAS\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2MAKAS", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum bey\2'in kalan saclari icin sakladigi makasi kestiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum ->\2 Elinde bir elfs kılıcı var, ama o elfs değil ki. Yo, elfs değil. Bu da nesi efendimiss? Bu da nesi?", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimisss \2TAS\2 secerek, \2Gollum\2un Makas'ini kirdi. ", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);
} else if (x == 2) {
send_cmd(s_NickServ, "NOTICE %s :Sizin Seciminiz -> \2TAS\2", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 arkadasimizin secimi -> \2TAS", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum\2 ile berabere kaldiniz.", u->nick);
send_cmd(s_NickServ, "NOTICE %s :\2Gollum -> \2 Bis biliyos. Hobbits için güvenli yolusu biliyos bis. Karanlığın içisindeki güvenli yol. ", u->nick);
send_cmd(s_NickServ, "NOTICE %s \2", u->nick);
send_cmd(s_NickServ, "PRIVMSG #operlog :\2%s\2 Kiymetlimisss \2TAS\2 ile Gollumsss ile yenisemedi.", u->nick);
send_cmd(s_NickServ, "NOTICE %s  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", u->nick);

    return;
}
}

}

/*********************************************************************************/

static void do_ident(User *u, char *param) {
    NickInfo *ni;
ni = get_nickinfo(u->nick);
    NickGroupInfo *ngi;

char *ident;
   ident = strtok_remaining();
 

   if (!ident) {
                send_cmd(s_NickServ, "NOTICE %s :Kullanim: \2/NS IDENT IDENTINIZ", u->nick);
return;
}
if (!ni) {
send_cmd(s_NickServ, "NOTICE %s Nickiniz kayitsizdir.", u->nick);
send_cmd(s_NickServ, "NOTICE %s Nickinizi kaydedip, tekrar deneyiniz.", u->nick);

return;
}
 if (!(ngi = get_ngi(ni))) {
                notice_lang(s_NickServ, u, INTERNAL_ERROR);
}


if (!param) {
   send_cmd(s_NickServ, "NOTICE %s \2Identiniz kaldirilmistir.", u->nick);
return;
} else {
free(ngi->ident);
ngi->ident = sstrdup(ident);
send_cmd(s_NickServ, "NOTICE %s Identiniz: %s", u->nick, ngi->ident);
send_cmd(s_NickServ, "CHGIDENT %s %s", u->nick, ngi->ident);
send_cmd(s_NickServ, "PRIVMSG #operlog 4%s2 Identini -> 4%s2 olarak degistirdi.", u->nick, ngi->ident);
put_nickgroupinfo(ngi);
}
}
