Cyclone Posted July 16, 2010 Share Posted July 16, 2010 well i m new to scripting ... i was trying a script xml..its seems my script is weird ,helpme problem in script : my script only gets the first line in attr when i was logined as 'kumar' it returns fail in console ,i dont know what to further this is server side script function settingg1(thePlayer,commandName,st) claf = xmlLoadFile("player.xml") if claf then if st == "1" then local guapo = xmlFindChild(claf,"guapo",0) local apName = xmlNodeGetAttribute(guapo,"aName") outputConsole(apName) local accou = getPlayerAccount (thePlayer) local acccname = getAccountName(accou) if (acccname == apName) then outputConsole("success") else outputConsole("fail") end end end end addCommandHandler("set",settingg1) and this is the player.xml file <root> <guapo aName="bala" /> <guapo aName="kumar" /> </root> HELP Note: sorry for my bad english Link to comment
eAi Posted July 16, 2010 Share Posted July 16, 2010 Consider using xmlNodeGetChildren instead of xmlFindChild. 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