Echo things to IRC
#1

Hello,

Currently working on my IRC script. Commands are working fine. But how can I echo something to my IRC channel?
I'm having a ZCMD command /ask sending it to all Administrators online. But how can I echo them also to my IRC channel?

pawn Код:
CMD:ask(playerid, params[])
    {
        {
        new string[128], reason[64];
        if(sscanf(params, "z", reason)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[Question]");
        else
        {
        SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[SERVER]"#COL_LRED" Your message has been send to all online administrators.");
        new pName[24];
        GetPlayerRame(playerid, pName, 128);
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    format(string, sizeof(string), ""#COL_BROWN"[ASK]"#COL_EASY" %s: %s ", pName, reason);
                    SendMessageToAdmins(COLOR_RED, string);
            }
        }
        }
        }
        return 1;
    }
Reply
#2

Anyone?
Reply
#3

You mean sending messages from in game to the IRC server?
Reply
#4

Yes, I'm having some commands that sends the messages from IRC > Game.
But now I need this message from Game > IRC.
Reply
#5

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Yes, I'm having some commands that sends the messages from IRC > Game.
But now I need this message from Game > IRC.
I havent heard yet about if its possible try to post this question on IRC Plugin thread and wait for an answer there.
Reply
#6

Yes I am 100% sure that it's possible. There is also a function:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[MAX_PLAYER_NAME], ircMsg[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(ircMsg, sizeof(ircMsg), "02[%d] 07%s: %s", playerid, name, text);
    IRC_GroupSay(gGroupID, IRC_CHANNEL, ircMsg);
    return 1;
}
But that's sending everything what you type in the mainchat. But not those commands like /ask
Reply
#7

For exemple
pawn Код:
IRCCMD:players(botid, channel[], user[], host[], params[]) {
    if(!strcmp(channel, IRC_CHANNEL_MAIN, true)) {
        new
            msgSz[32],
            playerCount;

        foreach(Player, i) {
            playerCount++;
        }

        format(msgSz, sizeof(msgSz), "Server Player Count: %d", playerCount);
        IRC_Say(BOT ID, IRC CHANNEL, msgSz);
    }
    return 1;
}
This command will say on IRC how many players are in the server. You can follow the exemple and i think its possible

EDIT: Use IRC_Say to show something on IRC channel
Reply
#8

Current code:
pawn Код:
CMD:ask(playerid, channel[], params[])
    {
        {
        new string[128], reason[64], msg[64];
        if(sscanf(params, "z", reason)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[Question]");
        else
        {
        SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[SERVER]"#COL_LRED" Your message has been send to all online administrators.");
        new pName[24];
        GetPlayerRame(playerid, pName, 128);
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    format(string, sizeof(string), ""#COL_BROWN"[ASK]"#COL_EASY" %s: %s ", pName, reason);
                    SendMessageToAdmins(COLOR_RED, string);
                   
                    format(string, sizeof(string), ""#COL_BROWN"[ASK]"#COL_EASY" %s: %s ", pName, reason);
                    IRC_GroupSay(gGroupID, channel, msg);
            }
        }
        }
        }
        return 1;
    }
Now the /ask command is also bugged ingame. You get:
[ASK] Henk Janus: PlayerCommandRecieved
instead of
[ASK] Henk Janus: Hello
Reply
#9

Nobody?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)