29.12.2010, 06:25
And if i want to make a ban log?
EXAMPLE BAN:
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);
}
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;
}