05.12.2009, 02:12
Код:
irccmd_bans(conn, channel[], user[], params[]) { #pragma unused conn,channel,user new string[200],list; if(!strlen(params)) return IrcSay("USAGE: !bans <ip>"); if(!ircIsOp(conn,channel,user)) return IrcSay(""IRC_AUTH_MSG""); new File:myFilez = fopen("/config/badips.txt", io_read); new bans; if(myFilez) { while(fread(myFilez, string, sizeof(string))) { if(strfind(params,string, true) == 0) { bans++; } } if(bans == 0) { format(string,sizeof(string),"3 The Server has found no bans for the ip '%s'",params); IrcSay(string); } else { format(string,sizeof(string),"3 The Server has found %d bans for the ip '%s'",list,params); IrcSay(string); } fclose(myFilez); } return 1; }