IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   Hazır_kodlar (https://www.ircforumlari.net/hazir_kodlar/)
-   -   m_helpmotd (/helpmotd) Helper Listesi (https://www.ircforumlari.net/hazir_kodlar/965734-m_helpmotd-helpmotd-helper-listesi.html)

YouMyCure 26 Şubat 2022 17:19

m_helpmotd (/helpmotd) Helper Listesi
 
Merhaba, bir arkadaşımın istedi üzerine yapmış olduğum bir modul,
KOMUT: /helpmotd

Kurulum: Unreal anadizinine ircd.helpmotd isimli dosya oluşturup içeriğini ekleyiniz.
Aşağıdaki modulu Unrealinizin src/modules klasörü içerisine atıp ssh'den Unreal anadizininize gelip, make custommodule MODULEFILE=m_helpmotd komutu ile kurunuz daha sonra sunucunuzda /rehash komutunu uygulayınız.

Kod:

/*
*  /helpmotd modulü by YouMyCure
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif

DLLFUNC int m_helpmotd(aClient *cptr, aClient *sptr, int parc, char *parv[]);

#define MSG_HELPMOTD        "HELPMOTD"       
#define TOK_HELPMOTD        "t"
#define HMOTD        "ircd.helpmotd"
       

ModuleHeader MOD_HEADER(m_helpmotd)
= {
          "m_helpmotd",
          "$Id$",
          "Helper Motd Eklentisi by YouMyCure /helpmotd",
          "3.2-b8-1",
          NULL
  };

  DLLFUNC int MOD_INIT(m_helpmotd)(ModuleInfo *modinfo)
  {
            add_Command(MSG_HELPMOTD, TOK_HELPMOTD, m_helpmotd, MAXPARA);
            MARK_AS_OFFICIAL_MODULE(modinfo);
            return MOD_SUCCESS;
  }

  DLLFUNC int MOD_LOAD(m_helpmotd)(int module_load)
  {
            return MOD_SUCCESS;
  }

  DLLFUNC int MOD_UNLOAD(m_helpmotd)(int module_unload)
  {
            if (del_Command(MSG_HELPMOTD, TOK_HELPMOTD, m_helpmotd) < 0)
            {
                    sendto_realops("Failed to delete commands when unloading %s",
                            MOD_HEADER(m_helpmotd).name);
            }
            return MOD_SUCCESS;
  }

  DLLFUNC int  m_helpmotd(aClient *cptr, aClient *sptr, int parc, char *parv[])
  {
    FILE *dosya;
    char buf[BUFSIZE];
    dosya = fopen(HMOTD, "r");
    if (dosya != NULL) {
      while (fgets(buf, sizeof(buf), dosya)) {
        sendto_one(sptr, ":%s", buf);
      }
      return 0;
    }

  }


Test Edilen Unreal Sürümü: 3.2.10.4

SNOOPY 26 Şubat 2022 17:31

Cevap: m_helpmotd (/helpmotd) Helper Listesi
 
Güzel kodlama keşke aktif edildiğinde kullanım sonucu verilen cevabı da paylaşsaydın

YouMyCure 26 Şubat 2022 17:37

Cevap: m_helpmotd (/helpmotd) Helper Listesi
 
Alıntı:

SNOOPY Nickli Üyeden Alıntı (Mesaj 1042630377)
Güzel kodlama keşke aktif edildiğinde kullanım sonucu verilen cevabı da paylaşsaydın

yanii, dosyaya ne eklersen onu verecek :d bende bu şekilde;
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 11:16.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk