Jump to content

Money Save XML


Tekken

Recommended Posts

Hi, i created this for saving players money in money.xml, and i get this error

Bad argument @'xmlNodeSetAttribute' string at [argument 3, got boolean]

my code

function saveMoney(thePlayer) 
    if fileExists("money.xml") then 
       fileDelete('money.xml') 
    end 
        local moneyFile = xmlCreateFile("money.xml", "money") 
        if not moneyFile then 
           outputChatBox(thePlayer, "Bani nu au putut fi incarcati!",255, 0, 0) 
           return 
        end 
        local count = 0 
        local players = getElementsByType ("player") 
        for i,v in ipairs(players) do 
        local money = xmlCreateChild (moneyFile, "money") 
        local pname = getPlayerUserName(v) 
        local psuma = getPlayerMoney(v) 
        xmlNodeSetAttribute(money, "usern", pname) 
        xmlNodeSetAttribute(money, "suma", psuma) 
end 
        xmlSaveFile (moneyFile) 
        xmlUnloadFile (moneyFile)         
end 
setTimer(saveMoney, 500, 0) 

Edited by Guest
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...