[SOLVED] Connection log.
#6

Add this anywhere in your script:

pawn Code:
forward ConnectLog(playerid);
public ConnectLog(playerid)
{
  new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new hour;
    new minute;
    new second;
    new day;
    new month;
    new year;
    getdate(year, month, day);
    gettime(hour,minute,second);
    new cmd[264];
    new File:Connections;
    Connections = fopen("logs/connections.log",io_append);
    format(cmd,sizeof(cmd),"[%02d/%02d/%02d %02d:%02d:%02d] Player: %s || ID: %d || IP: %s connected. \r\n",day, month, year, hour, minute, second,name,playerid,PlayerIP(playerid));
    fwrite(Connections,cmd);
    fclose(Connections);
    print(cmd);
    return 1;
}
and this above it

pawn Code:
stock PlayerIP(playerid)
{
    new IP[264];
    GetPlayerIp(playerid, IP, 264);
    return IP;
}
then add this under onplayerconnect:

pawn Code:
ConnectLog(playerid);
Reply


Messages In This Thread
[SOLVED] Connection log. - by kukars22 - 29.12.2009, 10:36
Re: [HELP] Connection log. - by Crezy-Boy - 29.12.2009, 12:11
Re: [HELP] Connection log. - by kukars22 - 29.12.2009, 12:48
Re: [HELP] Connection log. - by RoBo - 29.12.2009, 15:39
Re: [HELP] Connection log. - by kukars22 - 29.12.2009, 15:50
Re: [HELP] Connection log. - by [NYRP]Mike. - 29.12.2009, 16:55
Re: [HELP] Connection log. - by kukars22 - 29.12.2009, 17:51
Re: [HELP] Connection log. - by [NYRP]Mike. - 29.12.2009, 18:01
Re: [HELP] Connection log. - by RoBo - 29.12.2009, 23:15
Re: [HELP] Connection log. - by Westie - 29.12.2009, 23:25

Forum Jump:


Users browsing this thread: 2 Guest(s)