IRC Command Help
#1

Код:
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;
}
If if search for the ip it says its not banned when it is banned..
Reply
#2

Strfind returns the index of the first letter in the searching string (params)
Reply
#3

So if i just switch to strcmp it will work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)