WASSIm. Posted December 22, 2014 Share Posted December 22, 2014 hi guys, i have problem with script if start any resource server will take max of ram and got freezed addEventHandler("onResourceStart", root, function (resource) if (enableCompile) and (compileres[resource]) then --setResourceInfo(resource, "laststart", date) local resourceName = getResourceName(resource) for indox, script in ipairs (getResourceScripts(resource)) do local localFile = ":"..resourceName.."/"..script.."" local theScript = fileExists(localFile) and fileOpen(localFile, true) if (theScript) then local code = fileRead(theScript, fileGetSize(theScript)) fileClose(theScript) if not (string.byte(code) == 28) then disableJoinonSetup = true fetchRemote("https://luac.multitheftauto.com/?compile=1&debug=1&obfuscate=1", function(responseData, error) if (error == 0) and (responseData) then if (string.find(responseData, "ERROR")) then --outputDebugString(localFile..": "..responseData.."", 1) else fileDelete(localFile) local theScriptC = fileCreate(localFile) fileWrite(theScriptC, responseData) fileClose(theScriptC) outputDebugString(localFile..": Successfully compiled", 3) end else outputDebugString(localFile..": Failed to compiled", 1) end end, code, true) if (indox == #getResourceScripts(resource)) then disableJoinonSetup = false restartResource(resource) end else --outputDebugString(localFile..": Already compiled", 3) end end end end end) Link to comment
WASSIm. Posted December 22, 2014 Author Share Posted December 22, 2014 any help please ? Link to comment
Eth Posted December 23, 2014 Share Posted December 23, 2014 Can you try this and tell me if you saw "ss" and "ss2" in debug? addEventHandler("onResourceStart", root, function (resource) if (enableCompile) and (compileres[resource]) then --setResourceInfo(resource, "laststart", date) local resourceName = getResourceName(resource) for indox, script in ipairs (getResourceScripts(resource)) do local localFile = ":"..resourceName.."/"..script.."" local theScript = fileExists(localFile) and fileOpen(localFile, true) outPutDebugString("ss") if (theScript) then outPutDebugString("ss2") local code = fileRead(theScript, fileGetSize(theScript)) fileClose(theScript) if not (string.byte(code) == 28) then disableJoinonSetup = true fetchRemote("https://luac.multitheftauto.com/?compile=1&debug=1&obfuscate=1", function(responseData, error) if (error == 0) and (responseData) then if (string.find(responseData, "ERROR")) then --outputDebugString(localFile..": "..responseData.."", 1) else fileDelete(localFile) local theScriptC = fileCreate(localFile) fileWrite(theScriptC, responseData) fileClose(theScriptC) outputDebugString(localFile..": Successfully compiled", 3) end else outputDebugString(localFile..": Failed to compiled", 1) end end, code, true) if (indox == #getResourceScripts(resource)) then disableJoinonSetup = false restartResource(resource) end else --outputDebugString(localFile..": Already compiled", 3) end end end end end) Link to comment
MTA Team 0xCiBeR Posted December 23, 2014 MTA Team Share Posted December 23, 2014 outPutDebugString("ss") You misspelled it, it should be outputDebugString Also, the reason i'm sure is that you have a lot of resources and of course it freezes your server as it doesn't have enough ram to process all the requests. Link to comment
WASSIm. Posted December 23, 2014 Author Share Posted December 23, 2014 guys fine its sloved, problem on line 32 resource restart again and again... that why Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now