Vladimir1559 Posted June 19, 2013 Posted June 19, 2013 Hello! Can separate log on different files? E.g. "chat.log", "debug.log", "console.log", and other? Vladimir.
MIKI785 Posted June 21, 2013 Posted June 21, 2013 Wrong section. You can do this by scripting, but you won't be able to save the logs to "logs" folder but to the resource's folder. Lua Scripter Owner of mshost.cz MTA portal.
Sasu Posted June 23, 2013 Posted June 23, 2013 I only could do script that save chat and debug messages. See This: addEventHandler("onResourceStart", resourceRoot, function() local newFile = fileCreate("chatSay.log") local newFile2 = fileCreate("debugMsg.log") end ) addEventHandler("onPlayerChat", root, function(msg, msgType) local theFile = fileOpen("chatSay.log") if (theFile) then if msgType == 0 then theType = " say: " elseif msgType == 1 then theType = " (/me) " elseif msgType == 2 then theType = " (Team-Say): " end local time = getRealTime() local day = time.monthday local month = time.month local hour = time.hour local minute = time.minute local anterior = fileRead(theFile, 500) fileWrite(theFile, "[ "..hour..":"..minute.." - "..day.."/"..month.." ] "..getPlayerName(source)..""..theType..""..msg.."\n") fileClose(theFile) else outputDebugString("It is not possible to open the file 'chatSay.log'") end end ) addEventHandler("onDebugMessage", root, function(msg, lvl, file, line) local theFile = fileOpen("debugMsg.log") if (theFile) then if line == nil then line = "nil" end if file == nil then file = "nil" end if lvl == 0 then theLevel = "( "..file..":"..line.." ): " elseif lvl == 1 then theLevel = "ERROR ( "..file..":"..line.." ): " elseif lvl == 2 then theLevel = "WARNING ( "..file..":"..line.." ): " elseif lvl == 3 then theLevel = "INFO ( "..file..":"..line.." ): " end local anterior = fileRead(theFile, 500) fileWrite(theFile, theLevel..""..msg) fileClose(theFile) end end ) State: Inactive
Vladimir1559 Posted June 23, 2013 Author Posted June 23, 2013 Thanks, but I thought do this in source and compile it. // I know C++, but i don't know where search the part of responsible for this.
lil Toady Posted June 30, 2013 Posted June 30, 2013 Due to protection we apply, you will not be able to join public servers with a custom client. Do not PM me, im not going to read it anyway.
ixjf Posted July 1, 2013 Posted July 1, 2013 Wrong section.You can do this by scripting, but you won't be able to save the logs to "logs" folder but to the resource's folder. It is possible using modules. I used to know how to code, but then I took an arrow in the knee. Project Redivivus - Remaking Old School MTA With New Code MTA 0.6 Nightly 1 released
Recommended Posts