.:HyPeX:. Posted December 26, 2013 Share Posted December 26, 2013 Hello, i'm starting up XML to save radios within a player's serial. and i'm kinda trapped.. cant make it work.. i get errors all the way down. if xmlLoadFile("Radios.xml") then else xmlCreateFile("Radios.xml", "Players") end function asd() local serial = ""..getPlayerSerial(getLocalPlayer()).."" local radios = xmlLoadFile("Radios.xml") if not xmlFindChild(radios, serial, 0) then serialPlayer = xmlCreateChild(radios, serial) end if not xmlFindChild(serialPlayer, "Stations", 0) then stations = xmlCreateChild(serialPlayer, "Stations") end if not xmlNodeGetChildren("Stations") then station = xmlCreateChild("Stations", "0") xmlNodeSetAttribute("0", "Name", text) xmlNodeSetAttribute("0", "Link", text2) else local node = xmlNodeGetChildren(stations) local node2 = #node local node3 = node2 + 1 local stationQuantity = ""..node3.."" station = xmlCreateChild("Stations", stationQuantity) xmlNodeSetAttribute(station, "Name", text) xmlNodeSetAttribute(station, "Link", text2) end end Link to comment
.:HyPeX:. Posted December 26, 2013 Author Share Posted December 26, 2013 Bump, someone? i'm struck at making this work Link to comment
Sasu Posted December 26, 2013 Share Posted December 26, 2013 If you load/save/create a xml file, then it will save in the client, not in the server. Do you know that? Link to comment
.:HyPeX:. Posted December 26, 2013 Author Share Posted December 26, 2013 If you load/save/create a xml file, then it will save in the client, not in the server. Do you know that? Kinda forgot that point, but it should still work... Link to comment
Sora Posted December 27, 2013 Share Posted December 27, 2013 Nope , it depends on where your xml functions are located in for example if you locate this xml code in server-side file ( let's say server.lua ) it will save the xml file in the resource directory ( near by server.lua ) and the same way goes for client-side script Link to comment
.:HyPeX:. Posted December 27, 2013 Author Share Posted December 27, 2013 Nope , it depends on where your xml functions are located infor example if you locate this xml code in server-side file ( let's say server.lua ) it will save the xml file in the resource directory ( near by server.lua ) and the same way goes for client-side script Yes, but if i'm saving it and loading it client-side it should be able to be loaded by the client. Link to comment
Dealman Posted December 27, 2013 Share Posted December 27, 2013 Either way works, it's but a matter of personal preference. It would be of great help if you post all the errors and/or warnings you're getting. Rather than having us guess what errors you're getting... Link to comment
.:HyPeX:. Posted December 27, 2013 Author Share Posted December 27, 2013 Either way works, it's but a matter of personal preference.It would be of great help if you post all the errors and/or warnings you're getting. Rather than having us guess what errors you're getting... Errors on all the lines with any XML functions.. only the creating lines are okay. Link to comment
Dealman Posted December 27, 2013 Share Posted December 27, 2013 Errors on all the lines with any XML functions.. only the creating lines are okay. The number of errors are not interesting, the errors themselves are. How do you expect us to help you when you don't provide us with the errors you're getting? It's not like we're gonna sit here and guess what's wrong and why. Posting the errors would speed up the process tremendously. 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