#Paper Posted November 9, 2010 Share Posted November 9, 2010 What's wrong in this func? function savePlayerData (player,datatype,newvalue) local playerIP = getPlayerSerial(source) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile ("users.xml") xmlUnloadFile ("users.xml") return newNodeValue else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile ("users.xml") xmlUnloadFile ("users.xml") return newNodeValue end end end end end Link to comment
Aibo Posted November 9, 2010 Share Posted November 9, 2010 there's is a "player" here: function savePlayerData (player,datatype,newvalue) and "source" on the next line: local playerIP = getPlayerSerial(source) is source even passed to this function? otherwise i don't see what else is wrong. 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