What the person above me said, OR if you want commands in specific files:
pawn Код:
stock LogCommand(event[])
{
new File:log = fopen("command_log.txt", io_append);
fwrite(log, event);
fwrite(log, "\n");
fclose(log);
}
Should work by 'LogCommand();', however I did not test the code.
Example usage:
pawn Код:
COMMAND:heal(playerid, params[])
{
new target;
if(sscanf(params, "u", target)) return SendClientMessage(playerid, 0x00ff0f00, "Usage: /heal [playerid/name]");
else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x00ff0f00, "Invalid player!");
SetPlayerHealth(target, 100);
new gName[MAX_PLAYER_NAME], string[128];
GetPlayerName(target, gName, MAX_PLAYER_NAME);
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
format(string, sizeof string, "[HEAL] %s has healed %s", string, gName); //Important: Formats the string to log
CommandLog(string); //Log the string
return 1;
}
Hope that kind of explained it to you.