function getFileName(n)
n = n or 'NIL'
if chat_log_derictory ~= nil then
if not doesFileExist(chat_log_derictory.."\\" .. n ..".txt") then
f = io.open(chat_log_derictory.."\\" .. n ..".txt","w")
f:close()
file = string.format(chat_log_derictory.."\\" .. n ..".txt")
return file
else
file = string.format(chat_log_derictory.."\\" .. n ..".txt")
return file
end
end
end
--
if chat_log_derictory ~= nil then
local log = io.open(getFileName('DAMAGE GIVE'), "r+")
log:seek("end", 0);
log:write('['..os.date('%H:%M:%S')..']'.. string.format('ты нанес урон %s[%s],с оружия %s[%s] = %s \n',sampGetPlayerNickname(playerId),playerId,weapons.get_name(weapon),weapon,damage))
log:flush()
log:close()
end