SA-MP Forums Archive
IRC Bot private message function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IRC Bot private message function (/showthread.php?tid=252555)



IRC Bot private message function - _Outbreak_ - 01.05.2011

Hey, could anyone tell me how i can enable my irc bots to accept or reject commands or message from certain players. I'm talking about private messages not messages in the irc channel itself.


Re: IRC Bot private message function - dr.pepper - 01.05.2011

Is this what you mean?
pawn Код:
public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
{
    printf("*** IRC_OnUserSay (Bot ID %d): User %s (%s) sent message to %s: %s", botid, user, host, recipient, message);
    // Someone sent the first bot a private message
    if (!strcmp(recipient, BOT_1_NICKNAME))
    {
        IRC_Say(botid, user, "You sent me a PM!");
    }
    return 1;
}
On this line..
pawn Код:
if (!strcmp(recipient, BOT_1_NICKNAME))
You can change BOT_1_NICKNAME to other ones like this.. BOT_NUMBER_NICKNAME


Re: IRC Bot private message function - _Outbreak_ - 01.05.2011

Yeah, that's what i wanted, thanks. I'm using Jacobs plugin but re-writing my irc script and updating to incognitos, so this will be perfect. Thanks again.