05.03.2012, 17:58
Yeah, I think I somehow know what you want! You'd need to create a log for that:
Then, under a command, simply you could write into the log which you created, while creating a stock for your function:
Under your command, you could use this function then simply with one line:
pawn Код:
#define gatePATH "Logs/GateLog.txt" //directory for the log of gates
pawn Код:
stock GateLog(Target)
{
new File:Log = fopen(gatePATH, io_append);
new logData[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(Target,name,sizeof(name));
new fTime[6];
getdate(fTime[0], fTime[1], fTime[2]);
gettime(fTime[3], fTime[4], fTime[5]);
format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s performed an ACTION!\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], name);
fwrite(Log, logData);
fclose(Log);
return 1;
}
pawn Код:
GateLog(playerid);