30.06.2012, 14:41
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. |
pawn Код:
new File:cmdlog;
public OnGameModeInit()
{
cmdlog = fopen("logs/commands.txt", io_append);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
fwrite(cmdlog, cmdtext);
fwrite(cmdlog, "\r\n");
return 0;
}
public OnGameModeExit()
{
fclose(cmdlog);
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new File:cmdlog = fopen("logs/commands.txt", io_append);
fwrite(cmdlog, cmdtext);
fwrite(cmdlog, "\r\n");
fclose(cmdlog);
return 0;
}