need help with IRC
#1

pawn Код:
IRCCMD:say(botid, channel[], user[], host[], params[])
{
    if (IRC_IsVoice(botid, channel, user))
    {
        if (!isnull(params))
        {
            new msg[128];
            format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
            IRC_GroupSay(gGroupID, IRC_ECHOCHANNEL, msg);
            MessageALL(IRC_COL, msg);
            return 1;
        }
    }
    return 1;
}
This just started happening about a few weeks ago, before that it worked fine.
First of all, I have two connected bots and joined them to group gGroupID, then when I type !say, it sends the message ingame twice, and also sends it twice on the IRC channel (so basically it calls everything twice, for ever one time I use !say). Some other IRC cmds are also doing the same thing, does anyone know whats causing this? And no I don't have this function twice in my gamemode, I already double checked.

pawn Код:
gBotID[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
    IRC_SetIntData(gBotID[0], E_IRC_CONNECT_DELAY, 20);
    gBotID[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_2_NICKNAME, BOT_2_REALNAME, BOT_2_USERNAME);
    IRC_SetIntData(gBotID[1], E_IRC_CONNECT_DELAY, 30);
    gGroupID = IRC_CreateGroup();
Reply
#2

Bump, can anyone help me with this?
Reply
#3

Is this a script you have downloaded and used, ore you made yourself? (if downloaded, tell me where i can check the whole code)
Reply
#4

Did you actually add the bots to the group (IRC_AddToGroup)? Merely creating the group is not enough.
Reply
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
Did you actually add the bots to the group (IRC_AddToGroup)? Merely creating the group is not enough.
Yes

pawn Код:
public IRC_OnConnect(botid, ip[], port)
{
    if((botid == gBotID[0]) || (botid == gBotID[1]))
    {
        IRC_JoinChannel(botid, IRC_ECHOCHANNEL);
        IRC_AddToGroup(gGroupID, botid);
        return 1;
    }
}


Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
Is this a script you have downloaded and used, ore you made yourself? (if downloaded, tell me where i can check the whole code)
And no I did not download it, it was all working ok until it randomly started doing this about 2 weeks ago.
Reply
#6

still need help with this D:
Reply
#7

pawn Код:
IRCCMD:say(botid, channel[], user[], host[], params[])
{
    if (IRC_IsVoice(botid, channel, user))
    {
        if (!isnull(params))
        {
            new msg[128];
            new msg2[128];
            format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg2, sizeof(msg2), "*** %s on IRC: %s", user, params);
            SendClientMessageToAll(0x0000FFFF, msg2);
        }
    }
    return 1;
}
You don't need your own function MessageAll,just use the classic SendClientMessageToAll.
Reply
#8

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
pawn Код:
IRCCMD:say(botid, channel[], user[], host[], params[])
{
    if (IRC_IsVoice(botid, channel, user))
    {
        if (!isnull(params))
        {
            new msg[128];
            new msg2[128];
            format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg2, sizeof(msg2), "*** %s on IRC: %s", user, params);
            SendClientMessageToAll(0x0000FFFF, msg2);
        }
    }
    return 1;
}
You don't need your own function MessageAll,just use the classic SendClientMessageToAll.
lmao

You're just reformatting the same thing twice, whats the point in that?

And I don't use SendClientMessageToAll, MessageAll is a define to make it easier instead of having to type SendClientMessageToAll.

This still wouldn't solve my problem.
Reply
#9

Quote:
Originally Posted by DeathTone
Посмотреть сообщение
lmao

You're just reformatting the same thing twice, whats the point in that?

And I don't use SendClientMessageToAll, MessageAll is a define to make it easier instead of having to type SendClientMessageToAll.

This still wouldn't solve my problem.
I've formatted it twice because the first string get visible on the echo channel (so you can see what user said),and the second,obviously,it sends the message to the players.
Reply
#10

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
I've formatted it twice because the first string get visible on the echo channel (so you can see what user said),and the second,obviously,it sends the message to the players.
You can simply reformat the same string if you're gonna make them different (so no need for two strings), but other than that you can send the same string to whatever you want.

For example:
pawn Код:
new string[128];
format(string, 128, "String 1");
SendClientMessageToAll(RED, string); //Will send "String 1" to everybody
print(string); //Prints "String 1"
format(string, 128, "String 2");
SendClientMessageToAll(RED, string); //Will send "String 2" to everybody
print(string); //Prints "String 2"
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)