[HELP] Problems with a log
#3

And if i want to make a ban log?

pawn Код:
#define BAN_LOG     "BanLog/Banned.log"
forward BanLog(string[]);
pawn Код:
public BanLog(string[])
{
    new Year, Month, Day;
    getdate(Year, Month, Day);
   
    new PlayerIP[16];
    GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));

    new entry[256];
    format(entry, sizeof(entry), "[%02d.%02d.%d] {%d} %s\r\n",Day, Month, Year, PlayerIP, string);
    new File:hFile;
    hFile = fopen(BAN_LOG, io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}
EXAMPLE BAN:
pawn Код:
public OnPlayerSpawn(playerid)
{
    new name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, name, sizeof(name));

    format(string, sizeof(string), "Ban Log: %s(%d) spanwned to fast", name, playerid);
    BanLog(string);
    return 1;
}
Reply


Messages In This Thread
[HELP] Problems with a log - by Larsey123IsMe - 29.12.2010, 06:03
Re: [HELP] Problems with a log - by Joe Staff - 29.12.2010, 06:05
Re: [HELP] Problems with a log - by Larsey123IsMe - 29.12.2010, 06:25
AW: [HELP] Problems with a log - by Extremo - 29.12.2010, 06:54
Re: [HELP] Problems with a log - by Larsey123IsMe - 29.12.2010, 07:17
Re: [HELP] Problems with a log - by Mean - 29.12.2010, 08:17
Re: [HELP] Problems with a log - by Larsey123IsMe - 29.12.2010, 08:54
Re: [HELP] Problems with a log - by [03]Garsino - 29.12.2010, 09:02
Re: [HELP] Problems with a log - by Larsey123IsMe - 29.12.2010, 09:18

Forum Jump:


Users browsing this thread: 2 Guest(s)