logging connections ip
#2

Code:
OnPlayerConnect(playerid)
{
  new name[MAX_PLAYER_NAME], ip[40], string[200], day, month, year;
  GetPlayerName(playerid, name, sizeof(name));
  GetPlayerIp(playerid, ip, sizeof(ip));
  getdate(year, month, day);
  format(string, sizeof(string), "Connected IP: %s | Nick: %s | Date: %d/%d/%d \r\n", ip, name, day, month, year);
  if(fexist(ip_log.txt)){
    new File:log = fopen("ip_log.txt", io_append);
    fwrite(log, string);
    fclose(log);
  }
  return 1;
}
I hope it works :P.. if not contact me and I'll overwork it again (just wrote it up)..
Reply


Messages In This Thread
logging connections ip - by Face9000 - 26.10.2010, 16:48
Re: logging connections ip - by Sascha - 26.10.2010, 17:46

Forum Jump:


Users browsing this thread: 1 Guest(s)