Irc Command Help
#1

Код:
irccmd_ifn(conn, channel[], user[], params[])
{
  #pragma unused conn,channel,user
  new string[100];
  new data[256];
  if(!strlen(params)) return IrcSay("USAGE: !ifn <name>");
  if(!ircIsOp(conn,channel,user)) return IrcSay(""IRC_AUTH_MSG"");
  new File:JoinLog = fopen("/config/joinlog.txt", io_read);
  new found;
  if(!JoinLog) return IrcSay("Error: No Join Record (/config/joinlog.ini) found.");
  while(fread(JoinLog, string, sizeof(string)))
    {
      if(strfind(params,string, true))
      {
      found++;
  	  format(data,sizeof(data),"Found Record: %s",string);
      IrcSay(data);
	  }
    }
	if(found == 0) return IrcSay("* Sorry, no ips found for this player.");
	format(string,sizeof string,"* %d Join Records Have Been Found for the name '%s'",found,params);
	IrcSay(string);
	fclose(JoinLog);
	return 1;
}
what this does is search a file (/config/joinlog.ini), and return everything that has the name you search for (ex if i typed my name, it will return all ips with my name)... Why isnt it finding anything? I've tested it with my own name.

Thx for any help.
Reply
#2

Maby becouse of it cant find /config/ ? Or it doesnt save the IP/Log
Reply
#3

i have the file, it saves a new entry everytime someone enters:

Quote:

CJ101 - 127.0.0.1

^^ like that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)