Echoing messages to IRC??
#1

I'm wondering how i can echo messages to my IRC chennel that only & % and ~ can read...

At the moment i've got important messages shown to admins in game. I've looked at the script and tried it myself but the messages just echo so everyone in the channel can read them...

Reply
#2

I tried that, didn't really like it that way, just wondeirng how to send a message to & % ~ only...
Reply
#3

Oooh you can. Loop through the userlist and notice users with a specific mode.
Reply
#4

Thats what i was thinking...because you loop through for the % & and ~ for the irc to ingame commands, so there must be a way to loop through and send a message.

I'm new to the irc stuff so how would i loop through and then send the messages to the % & and ~
Reply
#5

Is this anything close to what i should have?

pawn Код:
stock SendPMecho(msg[])
{
    new ircLevel[4];
  ircGetUserLevel(conn, channel, user, ircLevel);
    if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1) || !strcmp(ircLevel, "%", true,1)) return true;
    ircSay(RandomBot(), channel, msg);
    return true;
    }
2 errors
pawn Код:
(1259) : error 017: undefined symbol "conn"
(1261) : error 017: undefined symbol "channel"
Reply
#6

define those errors.
Reply
#7

I tried that not sure what to define them as.

Anyone know how to fix this?
Reply
#8

Anyone know how i can echo certain messages from ingame to an IRC channel, that only % & @ ~ can read?

I've posted what i tried above but i got the two errors, not sure how to define those two to get it working.
Reply
#9

What u have to do:

- get the irc userlist into a string
- count all spaces in that string
- split the userlist string using strtok
- check whether the user has the mode you want
- send a notice to that user if so
Reply
#10

I've never really done anything with IRC stuff before, so its confusing for me..

Is the above code i posted anything close to what i need?

Reply
#11

Could someone tell me what i need to do for this? i really dont have a clue if im heading in the right direction with the above code or not.
Reply
#12

thanks for the reply. i'll search for that.
Reply
#13

-/msg %#chan text

This will just send the text to halfopped users and higher in a certain channel.
The rest is up to you
Reply
#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


Forum Jump:


Users browsing this thread: 10 Guest(s)