Jump to content

Problem with loading (xml)


bmat

Recommended Posts

Hello!

I've got a code:

function load()
local xmlFile = xmlLoadFile("save/bmat.xml")
if xmlFile then
local node = xmlFindChild(xmlFile, "money", 0)
local money = xmlNodeGetValue(node)
givePlayerMoney(source, tonumber(money))
end
end
addEventHandler("onPlayerJoin", getRootElement(), load)

It doesn't work. What is wrong? I want to give cash for player, which is loading from file. In file I've got:

<user>
<score>1</score>
<money>10000</money>
<skin>76</skin>
</user>

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...