WASSIm. Posted September 6, 2014 Share Posted September 6, 2014 (edited) hi guys i need help, i make script compile scripts on resources but how i an check if script compiled ? addEventHandler("onResourcePreStart", root, function (resource) if (resource == getThisResource()) then return end local resourceName = getResourceName(resource) if (compileres[resource]) then --setResourceInfo(resource, "laststart", date) for i, script in ipairs (getResourceScripts(resource)) do local theScript = fileOpen(":"..resourceName.."/"..script.."", true) if (theScript) then -- HERE end end end end) function getResourceScripts(resource) local scripts = {} local resourceName = getResourceName(resource) local theMeta = xmlLoadFile(":"..resourceName.."/meta.xml") for i, node in ipairs (xmlNodeGetChildren(theMeta)) do if (xmlNodeGetName(node) == "script") then local script = xmlNodeGetAttribute(node, "src") if (script) then table.insert(scripts, script) end end end xmlUnloadFile(theMeta) return scripts end Edited September 9, 2014 by Guest Link to comment
Moderators IIYAMA Posted September 8, 2014 Moderators Share Posted September 8, 2014 BUMP Maybe you should first correct your question before you go, , because it doesn't make sense. Link to comment
WASSIm. Posted September 9, 2014 Author Share Posted September 9, 2014 look i make script compile scripts on resources but how i can make it check if script compiled ? understood now ? Link to comment
Moderators IIYAMA Posted September 9, 2014 Moderators Share Posted September 9, 2014 Well you could check them manualy and if they are you can add in the meta.xml(per resource) a new setting, so you can skip them. Link to comment
myonlake Posted September 9, 2014 Share Posted September 9, 2014 Set the compiled file to a new extension, such as .luac. This way you know that file is compiled. Link to comment
arezu Posted September 9, 2014 Share Posted September 9, 2014 4 bytes Header signature: ESC, “Lua” or 0x1B4C7561• Binary chunk is recognized by checking for this signature In other words, you check if the first character of the code has value 0x1B (use string.byte to convert from string to byte value), and then if the three next values are "Lua". However if the code has also been encrypted, then you need to check for the encrypted byte values instead. The best way is to just check what 4 byte values are placed at the start of code compiled with luac.multitheftauto.com, and then also check the values when using encryption option. You can see the byte values if you open the script file with sublime text or just string.byte the value in mta to output it and use those values. Link to comment
WASSIm. Posted September 9, 2014 Author Share Posted September 9, 2014 4 bytes Header signature: ESC, “Lua” or 0x1B4C7561• Binary chunk is recognized by checking for this signature In other words, you check if the first character of the code has value 0x1B (use string.byte to convert from string to byte value), and then if the three next values are "Lua". However if the code has also been encrypted, then you need to check for the encrypted byte values instead. The best way is to just check what 4 byte values are placed at the start of code compiled with luac.multitheftauto.com, and then also check the values when using encryption option. You can see the byte values if you open the script file with sublime text or just string.byte the value in mta to output it and use those values. finally that i was answer waiting for, thanks i will try 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