Luk-ry Posted July 18, 2010 Share Posted July 18, 2010 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
MaddDogg Posted July 18, 2010 Share Posted July 18, 2010 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
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