19.06.2009, 16:26
pawn Код:
new printx_array[256]; //that is suppost to be above the first function
#define PrintX(%1) (format(printx_array, sizeof(printx_array), %1), print(printx_array), Log(printx_array))
pawn Код:
public OnPlayerSpawn(playerid)
{
PrintX("Lol? (ID %d)", playerid);
}
pawn Код:
stock Log(text[])
{
new
Hour,
Minute,
Second,
Year,
Month,
Day,
temp[256],
File:Log;
getdate(Year, Month, Day), gettime(Hour, Minute, Second);
format(temp, sizeof(temp), "Server/Log/%02d-%02d-%04d.txt", Day, Month, Year);
if(!fexist(temp)) Log = fopen(temp, io_write); else Log = fopen(temp, io_append);
format(temp, sizeof(temp), "[%02d:%02d:%02d] %s\r\n", Hour, Minute, Second, text);
fwrite(Log, temp), fclose(Log);
return true;
}