SA-MP Forums Archive
Echo things to IRC - 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: Echo things to IRC (/showthread.php?tid=275775)



Echo things to IRC - Kingunit - 11.08.2011

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;
    }



Re: Echo things to IRC - Kingunit - 11.08.2011

Anyone?


Re: Echo things to IRC - TheArcher - 11.08.2011

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


Re: Echo things to IRC - Kingunit - 11.08.2011

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


Re: Echo things to IRC - TheArcher - 11.08.2011

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.


Re: Echo things to IRC - Kingunit - 11.08.2011

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


Re: Echo things to IRC - TheArcher - 11.08.2011

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


Re: Echo things to IRC - Kingunit - 11.08.2011

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


Re: Echo things to IRC - Kingunit - 11.08.2011

Nobody?