Jump to content

xml problem


Luk-ry

Recommended Posts

I have a problem with my script.It doesn't work. :( The debugger shows : Bad argument @ xmlNodeSetValue, Bad argument @ xmlNodefindChild, Bad Argument @ xmlSaveFile and Bad argument @ xmlUnloadFile. Here is my script:

function changeSpawnpoint()
local root = xmlLoadFile ("spawnpoint.xml")
xmlFindChild ( root, "Spawn", 0 )
xmlNodeSetValue ( Spawn, "1")
xmlSaveFile ( root )
xmlUnloadFile ( root )
end
 
addCommandHandler ( "x", changeSpawnpoint)

and my xml:

<root>
root>

Link to comment

1. xmlLoadFile seems not to be able to open the file.

2. You don't save the node returning from xmlFindChild.

3. The variable 'Spawn' is empty, reason is above.

Check the name of the file, you're trying to open. Is it correct? Is it really in the resource root folder.

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