Echoing messages to IRC??
#14

well, i've just done something like this

Код:
stock MsgToOps(conn, channel, msg[])
{
	new ulist[512];
	ircGetUserList(conn, channel, ulist, sizeof(ulist));
	new spaces = CountSpaces(ulist);
	new users[spaces][30], idx;
	new ulevel[4], str[128];
	for (new i=0; i<spaces; i++)
	{
	  format(users[i], 30, "%s", strtok(ulist, idx));
	  ircGetUserLevel(conn, channel, users[i], ulevel);
	  if (strcmp(ulevel, "@") == 0 || strcmp(ulevel, "~") == 0 || strcmp(ulevel, "%") == 0 || strcmp(ulevel, "&") == 0)
	  {
	    format(str, sizeof(str), "PRIVMSG %s %s", users[i], msg);
	    ircSendRawData(conn, str);
	  }
	}
}

stock CountSpaces(str[])
{
	new cnt = 0;
	for (new i=0; i<strlen(str); i++)
	{
	  if (str[i] == ' ') cnt++;
	}
	return cnt;
}
i havent tested it and i dont know whether it works.. maybe Y_Less knows
Reply


Messages In This Thread
Echoing messages to IRC?? - by Outbreak - 31.01.2009, 18:36
Re: Echoing messages to IRC?? - by Outbreak - 31.01.2009, 21:18
Re: Echoing messages to IRC?? - by Streetplaya - 31.01.2009, 22:02
Re: Echoing messages to IRC?? - by Outbreak - 31.01.2009, 22:07
Re: Echoing messages to IRC?? - by Outbreak - 31.01.2009, 23:55
Re: Echoing messages to IRC?? - by smallo - 01.02.2009, 00:14
Re: Echoing messages to IRC?? - by Outbreak - 01.02.2009, 00:21
Re: Echoing messages to IRC?? - by Outbreak - 01.02.2009, 17:47
Re: Echoing messages to IRC?? - by Streetplaya - 01.02.2009, 21:01
Re: Echoing messages to IRC?? - by Outbreak - 01.02.2009, 22:03
Re: Echoing messages to IRC?? - by Outbreak - 06.02.2009, 20:05
Re: Echoing messages to IRC?? - by Outbreak - 06.02.2009, 21:39
Re: Echoing messages to IRC?? - by woot - 07.02.2009, 08:11
Re: Echoing messages to IRC?? - by Streetplaya - 07.02.2009, 08:29

Forum Jump:


Users browsing this thread: 11 Guest(s)