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/)
-   Unreal IRCd (https://www.ircforumlari.net/unreal-ircd/)
-   -   Joindeop yardım (https://www.ircforumlari.net/unreal-ircd/178745-joindeop-yardim.html)

Neotr 10 Şubat 2009 02:35

Joindeop yardım
 
Aşagıdaki kodda -o yaptıktan sonra kanala nasıl mesaj yazdırabiliriz
örnek: Kanalda op olamazsınız gibi

Kod:

    sendto_channel_butserv(chptr, (aClient *)find_server_quick_search(me.name), ":%s MODE %s %s %s",
      me.name, chptr->chname, "-o", cm->cptr->name);
    sendto_serv_butone(NULL, ":%s MODE %s %s %s", me.name, chptr->chname, "-o", cm->cptr->name);
    cm->flags &= ~CHFL_CHANOP;


toXic 10 Şubat 2009 12:23

Cevap: Joindeop yardım
 
Kod:

    sendto_channel_butserv(chptr, (aClient *)find_server_quick_search(me.name), ":%s MODE %s %s %s",
      me.name, chptr->chname, "-o", cm->cptr->name);
    sendto_serv_butone(NULL, ":%s MODE %s %s %s", me.name, chptr->chname, "-o", cm->cptr->name);
    cm->flags &= ~CHFL_CHANOP;
    send_cmd(s_ChanServ, "PRIVMSG %s :%s Op olamazsınız.", c->name, user->nick);

Bunu bir deneyin

Neotr 11 Şubat 2009 02:46

Cevap: Joindeop yardım
 
Hatalı oldu sanırım modulu tam vermediğimden kodda eksiklik oldu böyle kod mantıgını daha iyi anlarsınız kusura bakmayın tekrardan teşekkürler.


Kod:

#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
static int  cb_join(aClient *, aClient *, aChannel *, char *[]);

Hook *joindeop_hookjoin;
ModuleHeader MOD_HEADER(jointhrottle)
  = {
 "joindeop",
 "v1.0.0",
 "Deops non-opers on joining a new channel by w00t <[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]>",
 "3.2-b8-1",
 NULL
    };
DLLFUNC int MOD_INIT(jointhrottle)(ModuleInfo *modinfo)
{
 joindeop_hookjoin = HookAddEx(modinfo->handle, HOOKTYPE_LOCAL_JOIN, cb_join);
 return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(jointhrottle)(int module_load)
{
 return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(jointhrottle)(int module_unload)
{
 if (joindeop_hookjoin)
  HookDel(joindeop_hookjoin);
 
 joindeop_hookjoin = NULL;
 
 return MOD_SUCCESS;
}
static int cb_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *parv[])
{
 Member *cm;
 
 if (!IsOper(sptr))
 {
  //sendto_realops("%s is joining %s and not an oper", sptr->name, chptr->chname);
 
  /* appropriated from m_svsmode.c, why do_cmd didn't like me I have nfi.. */
  for (cm = chptr->members; cm; cm = cm->next)
  {
  //sendto_realops("Comparing %s to %s", cm->cptr->name, sptr->name);
  if (cm->cptr->name == sptr->name)
  {
    //sendto_realops("Match found.");
    if (cm->flags & CHFL_CHANOP)
    {
    Membership *mb;
   
    //sendto_realops("Match is opped, deopping.");
    mb = find_membership_link(cm->cptr->user->channel,
      chptr);   
   
    sendto_channel_butserv(chptr, (aClient *)find_server_quick_search(me.name), ":%s MODE %s %s %s",
      me.name, chptr->chname, "-o", cm->cptr->name);
    sendto_serv_butone(NULL, ":%s MODE %s %s %s", me.name, chptr->chname, "-o", cm->cptr->name);                                     
    cm->flags &= ~CHFL_CHANOP;
    if (mb)
      mb->flags = cm->flags;
    }
  }
  }
 }
 return HOOK_CONTINUE;
}


toXic 11 Şubat 2009 12:29

Cevap: Joindeop yardım
 
Bunu deneyin


Kod:

#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
static int  cb_join(aClient *, aClient *, aChannel *, char *[]);
Hook *joindeop_hookjoin;
ModuleHeader MOD_HEADER(jointhrottle)
  = {
 "joindeop",
 "v1.0.0",
 "Deops non-opers on joining a new channel by w00t <[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]>",
 "3.2-b8-1",
 NULL
    };
DLLFUNC int MOD_INIT(jointhrottle)(ModuleInfo *modinfo)
{
 joindeop_hookjoin = HookAddEx(modinfo->handle, HOOKTYPE_LOCAL_JOIN, cb_join);
 return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(jointhrottle)(int module_load)
{
 return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(jointhrottle)(int module_unload)
{
 if (joindeop_hookjoin)
  HookDel(joindeop_hookjoin);
 
 joindeop_hookjoin = NULL;
 
 return MOD_SUCCESS;
}
static int cb_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *parv[])
{
 Member *cm;
 
 if (!IsOper(sptr))
 {
  //sendto_realops("%s is joining %s and not an oper", sptr->name, chptr->chname);
 
  /* appropriated from m_svsmode.c, why do_cmd didn't like me I have nfi.. */
  for (cm = chptr->members; cm; cm = cm->next)
  {
  //sendto_realops("Comparing %s to %s", cm->cptr->name, sptr->name);
  if (cm->cptr->name == sptr->name)
  {
    //sendto_realops("Match found.");
    if (cm->flags & CHFL_CHANOP)
    {
    Membership *mb;
 
    //sendto_realops("Match is opped, deopping.");
    mb = find_membership_link(cm->cptr->user->channel,
      chptr);   
 
    sendto_channel_butserv(chptr, (aClient *)find_server_quick_search(me.name), ":%s MODE %s %s %s",
      me.name, chptr->chname, "-o", cm->cptr->name);
    send_cmd(s_ChanServ, "PRIVMSG %s :%s Op olamazsınız.", c->name, user->nick);
    sendto_serv_butone(NULL, ":%s MODE %s %s %s", me.name, chptr->chname, "-o", cm->cptr->name);                                     
    cm->flags &= ~CHFL_CHANOP;
    if (mb)
      mb->flags = cm->flags;
    }
  }
  }
 }
 return HOOK_CONTINUE;


Neotr 11 Şubat 2009 23:07

Cevap: Joindeop yardım
 
Buda olmadı maalesef

Kod:

joindeop.c: In function âcb_joinâ:
joindeop.c:94: error: âs_ChanServâ undeclared (first use in this function)
joindeop.c:94: error: (Each undeclared identifier is reported only once
joindeop.c:94: error: for each function it appears in.)
joindeop.c:94: error: âcâ undeclared (first use in this function)
joindeop.c:94: error: âuserâ undeclared (first use in this function)
joindeop.c:103:23: warning: no newline at end of file
joindeop.c:103: error: expected declaration or statement at end of input
make[2]: *** [custommodule] Error 1
make[2]: Leaving directory `/home/domain/Unreal3.2/src/modules'
make[1]: *** [custommodule] Error 2
make[1]: Leaving directory `/home/domain/Unreal3.2/src'
make: *** [custommodule] Error 2


GemLik 11 Şubat 2009 23:39

Cevap: Joindeop yardım
 
Kod:

  sendto_channel_butserv(chptr, (aClient *)find_server_quick_search(me.name), ":%s MODE %s %s %s",
      me.name, chptr->chname, "-o", cm->cptr->name);
    sendto_serv_butone(NULL, ":%s MODE %s %s %s", me.name, chptr->chname, "-o", cm->cptr->name);
sendto_one(cptr, ":%s PRIVMSG %s :Op olamazsınız",me.name, cptr->name, me.name);
            aClient *cptr;
    cm->flags &= ~CHFL_CHANOP;

şu şekilde editleyip modulu tekrar kurun birde sanırım istediğiniz olacaktır.


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

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