Rather than convert log_to_file, it would be better do use a custom function, like cache the file path in a global var so you only need to retrieve it once, and also, when you use a specific file, that file could also be plugin specific, so there is no need to add again the plugin name in the log.
PHP Code:
#include <amxmodx>
const MAX_LOG_LENGTH = 256
new g_szLogFile[64] // addons/amxmodx/logs/ = 20
public plugin_init()
{
get_localinfo("amxx_logs", g_szLogFile, charsmax(g_szLogFile))
add(g_szLogFile, charsmax(g_szLogFile), "/your_log_file.log")
}
LogToFile(const fmt[], any:...)
{
new szLog[MAX_LOG_LENGTH]
vformat(szLog, charsmax(szLog), fmt, 2)
new fp = fopen(g_szLogFile, "at")
fprintf(fp, "%s^n", szLog)
fclose(fp)
}
Then you can do :
LogToFile("%s has killed %s", szKillerName, szVictimName)
__________________