07.02.2009, 08:29
well, i've just done something like this
i havent tested it and i dont know whether it works.. maybe Y_Less knows
Код:
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; }