undefined Posted August 16, 2014 Share Posted August 16, 2014 Hi guys. Im working on the shader panel. But i have a problem on the save player options. When the player's xml changed, the code is not delete file and not again started the getOption function. It's not give error on warning on debug. Where is the problem??? local shaders = {"radialBlur","bloom","detailWater","contrast","detail","customTiles","carPaint","damageEffect","depthField","skinMods","vehicleMods","weaponMods","adjustWeapons"} function getOption() local node = xmlLoadFile("shader/settings.xml") if node then for k, v in ipairs(xmlNodeGetChildren(node)) do local name = xmlNodeGetAttribute(v, "name") local toggle = xmlNodeGetAttribute(v, "use") local value = xmlNodeGetAttribute(v, "value") local enable if not shaders[k] == name then fileDelete("shader/settings.xml") getOption() return end outputChatBox("Test") if toggle == "true" then enable = true elseif toggle == "false" then enable = false end end else local childs = {} local node = xmlCreateFile("shader/settings.xml", "settings") childs[1] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[1], "name", "radialBlur") xmlNodeSetAttribute(childs[1], "use", "true") childs[2] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[2], "name", "bloom") xmlNodeSetAttribute(childs[2], "use", "false") childs[3] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[3], "name", "detailWater") xmlNodeSetAttribute(childs[3], "use", "true") childs[4] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[4], "name", "contrast") xmlNodeSetAttribute(childs[4], "use", "false") childs[5] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[5], "name", "detail") xmlNodeSetAttribute(childs[5], "use", "false") childs[6] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[6], "name", "customTiles") xmlNodeSetAttribute(childs[6], "use", "true") childs[7] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[7], "name", "carPaint") xmlNodeSetAttribute(childs[7], "use", "true") childs[8] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[8], "name", "damageEffect") xmlNodeSetAttribute(childs[8], "use", "true") childs[9] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[9], "name", "depthField") xmlNodeSetAttribute(childs[9], "use", "true") childs[10] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[10], "name", "skinMods") xmlNodeSetAttribute(childs[10], "use", "true") childs[11] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[11], "name", "vehicleMods") xmlNodeSetAttribute(childs[11], "use", "true") childs[12] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[12], "name", "weaponMods") xmlNodeSetAttribute(childs[12], "use", "true") childs[13] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[13], "name", "adjustWeapons") xmlNodeSetAttribute(childs[13], "use", "true") xmlNodeSetAttribute(childs[13], "value", "100") xmlSaveFile(node) xmlUnloadFile(node) end end addEventHandler("onClientResourceStart", resourceRoot, getOption) Thnx Link to comment
undefined Posted August 16, 2014 Author Share Posted August 16, 2014 Help pls!!..!!.. Link to comment
Et-win Posted August 16, 2014 Share Posted August 16, 2014 Put some 'outputChatBox' codes in after every line (For example) and give them number, as soon as a number is not displayed you know your error. 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