SA-MP Forums Archive
Irc Command Help - 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: Irc Command Help (/showthread.php?tid=117574)



Irc Command Help - CJ101 - 31.12.2009

Код:
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.


Re: Irc Command Help - Julian2574 - 31.12.2009

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


Re: Irc Command Help - CJ101 - 31.12.2009

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

Quote:

CJ101 - 127.0.0.1

^^ like that