rE5vK8bu Posted March 4, 2016 Share Posted March 4, 2016 warn.xml: string = "Wait... Press '%s' (you must not move!)"/> function: function getStringFromID(text) if type(strings)~= "table" then local file = xmlLoadFile("warn.xml") strings = {} if file then for _,v in ipairs(xmlNodeGetChildren(file))do strings[xmlNodeGetName(v)] = xmlNodeGetAttribute(v,"string") end xmlUnloadFile(file) end end return strings[tostring(text)] or "" end --getStringFromID("wait_for_move") --return "Wait... Press '..key..' (you must not move!)" How i get string id from value xml? Example: string = "y"/> I want get x from y How i do to get x? Link to comment
rE5vK8bu Posted March 5, 2016 Author Share Posted March 5, 2016 I tried using xmlNodeGetName 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