SA-MP Forums Archive
IRC Chat to Server Chat? - 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)
+--- Thread: IRC Chat to Server Chat? (/showthread.php?tid=411819)



IRC Chat to Server Chat? - Admigo - 30.01.2013

Hi all,

I succesfull made a channel that is connected to the server.
If i chat in the server i see it in the irc chat.
But how can i make if i talk in irc chat it will appear in the serveer chat.

Admigo


Re: IRC Chat to Server Chat? - ThePhenix - 30.01.2013

https://sampforum.blast.hk/showthread.php?tid=98803


Re: IRC Chat to Server Chat? - Admigo - 30.01.2013

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
I already use the irc plugin.
I just dont know what callback i need to use for this.


Re: IRC Chat to Server Chat? - kaisersouse - 30.01.2013

I'll post an !isay command as an example hold on...

Код:
IRCCMD:isay(botid, channel[], user[], host[], params[])
{
	// Check if the user has at least voice in the channel
	if (IRC_IsVoice(botid, channel, user))
	{
		// Check if the user entered any text
		if (!isnull(params))
		{
			new msg[128];
			// Echo the formatted message
			format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
			IRC_GroupSay(groupID, channel, msg);
			format(msg, sizeof(msg), "{FFFFFF}***{7CFC00}[IRC] - %s:{FFFFFF} %s", user, params);
			SendClientMessageToAll(COLOR_BRIGHTGREEN, msg);
		}
	}
	return 1;
}
So when I do "!isay hi there!" in IRC, the server (in-game) sees "kaisersouse on IRC: hi there!"

Personally I label my IRC->SAMP commands w/ "i" in the front to denote them as irc commands. Also most IRC servers have a built-in !say so adding "i" at the beginning keeps default !say and IRC !isay from colliding


Re: IRC Chat to Server Chat? - Admigo - 30.01.2013

Quote:
Originally Posted by kaisersouse
Посмотреть сообщение
I'll post an !isay command as an example hold on...

Код:
IRCCMD:isay(botid, channel[], user[], host[], params[])
{
	// Check if the user has at least voice in the channel
	if (IRC_IsVoice(botid, channel, user))
	{
		// Check if the user entered any text
		if (!isnull(params))
		{
			new msg[128];
			// Echo the formatted message
			format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
			IRC_GroupSay(groupID, channel, msg);
			format(msg, sizeof(msg), "{FFFFFF}***{7CFC00}[IRC] - %s:{FFFFFF} %s", user, params);
			SendClientMessageToAll(COLOR_BRIGHTGREEN, msg);
		}
	}
	return 1;
}
So when I do "!isay hi there!" in IRC, the server (in-game) sees "kaisersouse on IRC: hi there!"

Personally I label my IRC->SAMP commands w/ "i" in the front to denote them as irc commands. Also most IRC servers have a built-in !say so adding "i" at the beginning keeps default !say and IRC !isay from colliding
Thanks you so much


AW: IRC Chat to Server Chat? - Blackazur - 30.01.2013

Or that without the Cmd:

Код:
public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
{
    new string[128];
    format(string, sizeof(string), "%s on Irc: %s", user, message);
    SendClientMessageToAll(WHITE, string);
	return 1;
}