IRC Chat to Server Chat?
#1

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
Reply
#2

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

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

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
Reply
#5

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
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)