Jump to content

XML and GUI


.:HyPeX:.

Recommended Posts

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

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
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

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
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

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. :roll:

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...