Jump to content

XML Values


[GuNNeR]

Recommended Posts

Hey , This is a small test for a script im trying to make

function valTest(source)
    local StatsFile = xmlLoadFile ( "stats.xml" )
    local nick = getPlayerName(source)
    local node1 = xmlFindChild ( StatsFile, "Player"..nick,0 )
    local statsNode = xmlNodeGetAttribute(node1, "level")
    local oldlvl= xmlNodeGetAttribute(node1, "oldlevel")
    local old = xmlNodeSetAttribute ( node1 ,"oldlevel", statsNode )
 outputChatBox(oldlvl)
end

What im trying to do is store the level of the player as oldlvl so i can compare the new level he will get later on in the script

Everything sets perfectly in the xml file ,The only thing is that when i output oldlvl in the chatbox , even though in the xml file it says oldlvl="3" it will output the same value statsNode has

any ideas?

GuNNeR

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...