Beluga Posted November 11, 2010 Share 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? Link to comment
dzek (varez) Posted November 11, 2010 Share Posted November 11, 2010 something is wrong with loading xml Link to comment
Beluga Posted November 11, 2010 Author Share Posted November 11, 2010 (edited) Damn forgot to add to meta.xml Edited November 11, 2010 by Guest Link to comment
Castillo Posted November 11, 2010 Share Posted November 11, 2010 make it a folder else you won't be able to edit the data from players.xml. Link to comment
Castillo Posted November 11, 2010 Share 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. Link to comment
dzek (varez) Posted November 11, 2010 Share Posted November 11, 2010 oh, you are right. thought you are telling to make a folder inside resource and put there that xml file.. Link to comment
Castillo Posted November 11, 2010 Share Posted November 11, 2010 lol, that doesn't make any difference. Link to comment
dzek (varez) Posted November 11, 2010 Share Posted November 11, 2010 that's why i asked Link to comment
Beluga Posted November 11, 2010 Author Share Posted November 11, 2010 So I just have to put all my scripts in a folder and then it is working? Link to comment
Beluga Posted November 11, 2010 Author Share 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! Link to comment
dzek (varez) Posted November 11, 2010 Share Posted November 11, 2010 post your meta, post your xml file. Link to comment
Beluga Posted November 11, 2010 Author Share 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 Link to comment
dzek (varez) Posted November 11, 2010 Share 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 Link to comment
DiSaMe Posted November 11, 2010 Share Posted November 11, 2010 Server-side XML doesn't need to be put into meta.xml. Link to comment
Beluga Posted November 12, 2010 Author Share Posted November 12, 2010 I added this but I don't help I just don't add a subnode into players.xml 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