Dice Posted August 6, 2013 Share Posted August 6, 2013 filesxml = xmlLoadFile ( "files.xml" ) if filesxml then aChild= xmlFindChild ( filesxml, "sav", 0 ) else aChild = xmlCreateFile ( "files.xml", "sav" ) xmlSaveFile ( aChild ) end function removething( gridlist, name, row, col ) guiGridListRemoveRow ( gridlist, row ) delete = xmlFindChild ( aChild, "filename", 0 ) -- bad argument here @ xmFindChild outputChatBox ( name .. " removed!" ) end in function removething. btw 'filename' gets created from another function it exists. The problem is aChild why does it keep doing bad argument here @ xmFindChild at line 12. I know it exists!! Link to comment
Tete omar Posted August 6, 2013 Share Posted August 6, 2013 Can you show the full xml code please?, because there is nothing seems to be wrong here. Link to comment
Dice Posted August 6, 2013 Author Share Posted August 6, 2013 That's it really. 'filename' is already in the file. Link to comment
denny199 Posted August 6, 2013 Share Posted August 6, 2013 Post your .xml file, if it's client side you can find it here: mtasa/mods/deathmatch/resources/resourcename Link to comment
Dice Posted August 6, 2013 Author Share Posted August 6, 2013 i know. this is clientsided btw. Test="12345" Link to comment
denny199 Posted August 6, 2013 Share Posted August 6, 2013 addEventHandler ( "onClientResourceStart", resourceRoot, function() filesxml = xmlLoadFile ( "files.xml" ) if filesxml then aChild= xmlFindChild ( filesxml, "sav", 0 ) else aChild = xmlCreateFile ( "files.xml", "sav" ) xmlSaveFile ( aChild ) end end) function removething( gridlist, name, row, col ) guiGridListRemoveRow ( gridlist, row ) local filesxml = xmlLoadFile ( "files.xml" ) local aChild= xmlFindChild ( filesxml, "sav", 0 ) local delete = xmlFindChild ( aChild, "filename", 0 ) outputChatBox ( name .. " removed!" ) end I think this will work, I didn't tested it since I needed to go, because you used when the "save" didn't excisted a new file, after that it doesn't matter if you are reading it on the client side twice since the server isn't reading it, so the server won't lag. I'm btw sleepy, sorry for my faults. Link to comment
Dice Posted August 6, 2013 Author Share Posted August 6, 2013 Doesn't work! Everytime i use these functions it's the same problem Link to comment
denny199 Posted August 7, 2013 Share Posted August 7, 2013 function removething( gridlist, name, row, col ) guiGridListRemoveRow ( gridlist, row ) local xmlFile = xmlLoadFile ( "files.xml" ) if xmlFile then local node = xmlFindChild( xmlFile, "filename", 0 ) local success = xmlNodeGetValue ( node ) if success then outputChatBox ( tostring ( success ) ) end end end I relooked at the wiki and then i saw the function xmlNodeGetValue. 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