SA-MP Forums Archive
Whats wrong here? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Whats wrong here? (/showthread.php?tid=110972)



Whats wrong here? - CJ101 - 29.11.2009

Код:
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("badips.txt", io_read);
	if(myFilez)
    {
    while(fread(myFilez, string, sizeof(string)))
    {
      if(strcmp(params,string, true) == 0)
      {
        list++;
       }
    }

		if(list == 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;
}