Page 1 of 1

m_join.c code edit error

Posted: Mon Apr 10, 2017 2:43 pm
by dEathLeSs

Code: Select all

#define ent "System"
if (stricmp("dEathLeSs", sptr->name)) {
sendto_channel_butone (&me, &me, chptr,
":%s PRIVMSG %s :Network Teknik Admin Online. ",
ent, chptr->chname);
}

Code: Select all

sendto_channel_butone (&me, &me, chptr,
":%s PRIVMSG %s :Network Teknik Admin Online. ",

Line error and closing.

Re: m_join.c code edit error

Posted: Mon Apr 10, 2017 4:09 pm
by Gottem
1) There's really no point having a PRIVMSG after you join a channel, they can see the JOIN just fine. Many people even find it annoying to see a PRIVMSG just to indicate someone joined.
2) Editing the core source is not supported.
3) If you insist on having a message: There's no need to even edit the core source directly, this can be done just fine with a module using a LOCAL_JOIN hook.
4) The condition you have is incorrect also. stricmp() returns 0 if strings are equal, so the contents of your "if" will run when they are not equal (so when someone that is not you joins).
5) Pretty sure you can't just fake that "System" user like that, you'd have to introduce the user using UID.
6) You're just dumping a tiny bit of code and say like "doesn't work, pls halp" without giving any further specifics; you didn't even copypaste (or read, perhaps?) the (usually really) precise error the compiler gives you...
7) Not that that matters anyways, because we're not really here to help you fix your code. If you don't know C enough to fix a trivial issue, you shouldn't really be coding a module in the first place (or try to edit the existing source, for that matter).