Beluga Posted November 11, 2010 Posted November 11, 2010 addEvent("registerPlayer",true) addEventHandler("registerPlayer",getRootElement(), function(username,password) local xmlFile = xmlLoadFile("players.xml") local playerNode = xmlFindChild(xmlFile,"players",0) if (playerNode) then xmlCreateChild(playerNode,tostring(username)) else xmlCreateChild(xmlFile,"players") end end) This code gives two WARNING: Bad argument errors: Bad argument @ 'xmlNodeFindChild' - line: 5 Bad argument @ 'xmlCreateChild' - line: 9 Someone can help me with this?
Beluga Posted November 11, 2010 Author Posted November 11, 2010 (edited) Damn forgot to add to meta.xml Edited November 11, 2010 by Guest
Castillo Posted November 11, 2010 Posted November 11, 2010 make it a folder else you won't be able to edit the data from players.xml.
Castillo Posted November 11, 2010 Posted November 11, 2010 if i'm right you can't edit data if the resource is in a zip file, at least never worked like that for me.
dzek (varez) Posted November 11, 2010 Posted November 11, 2010 oh, you are right. thought you are telling to make a folder inside resource and put there that xml file..
Beluga Posted November 11, 2010 Author Posted November 11, 2010 So I just have to put all my scripts in a folder and then it is working?
Beluga Posted November 11, 2010 Author Posted November 11, 2010 Sorry for double post but I put all the files in a folder and not in .zip file but I still get the badArgument thingy!
Beluga Posted November 11, 2010 Author Posted November 11, 2010 Meta file: <meta> <info author="Cornelis" type="script"/> <file src="players.xml"/> <script src="gui_s.lua" type="server"/> <script src="gui.lua" type="client"/> </meta> Players xml <players> </players> //EDIT: It don't show any errors anymore but It don't make a subnode in players.xml
dzek (varez) Posted November 11, 2010 Posted November 11, 2010 afair - XML for server side should be loaded in other way than yup, i am right: https://wiki.multitheftauto.com/wiki/Meta.xml
DiSaMe Posted November 11, 2010 Posted November 11, 2010 Server-side XML doesn't need to be put into meta.xml.
Beluga Posted November 12, 2010 Author Posted November 12, 2010 I added this but I don't help I just don't add a subnode into players.xml
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