IRC - SA-MP
#1

Hi guys. I just got an IRC network setup under my VPS last night and would actually like to use it for my SA-MP server. Allowing people in-game to talk to people on the IRC network, and vice versa. If possible, using this plugin. Could somebody explain how to do this.. or at least help me? Thanks!
Reply
#2

see the sample script for more info...
it is not hard to set up bots for your IRC echo system if you already know PAWN.
Reply
#3

Id say it is quite self-explaining. At first connect to a server, then join the channel. In OnPlayerText you can use IRC_Say (maybe format a string first, to make it start with the sendername or so).
To get the chat ingame, use SendClientMessageToAll in the callback IRC_OnUserSay
Reply
#4

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
To get the chat ingame, use SendClientMessageToAll in the callback IRC_OnUserSay
Somehow using a command (aka the "!say" or something) is better...
Reply
#5

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Id say it is quite self-explaining. At first connect to a server, then join the channel. In OnPlayerText you can use IRC_Say (maybe format a string first, to make it start with the sendername or so).
To get the chat ingame, use SendClientMessageToAll in the callback IRC_OnUserSay
So it's that simple... Weird. I had figured it would be a whole hell of a lot harder. I'll give it a shot, thanks!
Reply
#6

Okay, so I've got one issue. When I send a message from the server, to the IRC network, the (in this case BotB) bot will actually send the message back to the server, but the people in the IRC network get it. So it's just like a sent the message in twice. This is what I'm currently using, which is just a little modified from Incognito's example script.

pawn Код:
public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
{
    new string[128];
    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!");
    }
    if(!strcmp(recipient, BOT_2_NICKNAME))
    {
        return 1;
    }
    else
    {
        format(string, sizeof(string), "[IRC] %s: %s", user, message);
        SendClientMessageToAll(COLOR_WHITE, string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)