zixxonx Posted December 31, 2013 Share Posted December 31, 2013 Im making a shader panel/scoreboard columns panel and thats my xml file: "true" carpaint="false" roadshine="false" killscol="true" deathscol="true" winscol="true"> That's good and it should work but i think those true and false are just strings, i did it local shaderwater = xmlNodeGetAttribute(xmlFile,"shaderwater") then outputChatBox(shaderwater) I should get error talking me about booleans but it shows the value also i must did it: xmlNodeSetAttribute(xmlFile,"shaderwater",tostring(getElementData(player, "shaderwater"))) To save it properly. Can i change those strings too booleans or is there any other function to save booleans properly? Link to comment
Plean Posted December 31, 2013 Share Posted December 31, 2013 local shaderwater = xmlNodeGetAttribute(xmlFile,"shaderwater") == "true" and true or false This should convert strings to booleans. Link to comment
xXMADEXx Posted December 31, 2013 Share Posted December 31, 2013 function convertStringToBoolean ( str ) local str = tostring ( string.lower ( str ) ) if ( str == 'true' ) then return true elseif ( str == 'false' ) then return false end return nil end 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