28.06.2012, 21:16
Quote:
Do you know WHY people claim that dini isn't a very good file system? Because it's slow! Why is it slow? Because it opens, writes, and closes, the file for EVERY operation instead of buffering data for more efficient writes. You figure out why I'm telling you this.
Also, we have a shiny new "Includes" forum - I moved this one there but you might want to pay more attention in the future. |
And yes, I just noticed. thank you
EDIT:
Код:
new File:cmdlog = fopen("logs/commands.txt", io_append); fwrite(cmdlog, text); fwrite(cmdlog, "\r\n"); fclose(cmdlog);
EDIT2:
Working on a solution, would like your opinion once its done
EDIT 3:
What would you think of this? Would this take loads of memory?
I have no experience on this part of coding/scripting, so this might be absolute shit what I'm posting now.
pawn Код:
new logline[MAX_PLAYERS][10][128];
new logamount[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
logamount[playerid] = 0;
canpm[playerid] = 1;
return 1;
}
forward writecmdlog(text[]);
stock writecmdlog(text[])
{
if(logamount[playerid] < 10)
{
logamount[playerid] ++;
format(logline[playerid][logamount[playerid]], sizeof(logline[playerid][logamount[playerid]]), text);
}
else
{
new File:cmdlog = fopen("logs/commands.txt", io_append);
for(new i=1; i<11; i++)
{
fwrite(cmdlog, logline[playerid][i]);
fwrite(cmdlog, "\r\n");
}
fclose(cmdlog);
}
return 1;
}
Might be shit though