ZenoS Posted December 20, 2011 Share Posted December 20, 2011 Hello, I am trying to make a nice teamscript, but it just doesn't work, i've looked at it for a while and i can't find what im doing wrong. function receiveNewTeamData ( teamName, teamPassword, r, g, b ) createTeam((teamName), r, g, b) opslaanGegevens(teamName,teamPassword) end addEvent ( "onReceiveNewTeamData", true ) addEventHandler ( "onReceiveNewTeamData", getRootElement(), receiveNewTeamData ) function opslaanGegevens(teamName,teamPassword) outputChatBox("test"..teamName.." test"..teamPassword.."") teamXmlFile = xmlLoadFile ( "teamInfo.xml" ) if not teamXmlFile then teamXmlFile = xmlCreateFile ( "teamInfo.xml", "teams" ) end local teamChildNode = xmlFindChild ( teamXmlFile, teamName, 1 ) if teamChildNode then xmlNodeSetAttribute ( teamChildNode, "password", teamPassword ) xmlSaveFile (teamXmlFile) end if not teamChildNode then teamChildNode = xmlCreateChild (teams, teamName) xmlNodeSetAttribute ( teamChildNode, "password", teamPassword) xmlSaveFile (teamXmlFile) outputChatBox("9") end end my problem is, the server doesn't read the attribute at teamChildNode = xmlCreateChild (teams, teamName) xmlNodeSetAttribute ( teamChildNode, "password", teamPassword) somehow, but it works at the top function, i think somehow i've failed with the transfer, tested some with it, but it still doesn't work. So now im pretty desperate, so im asking you guys if you could find whats wrong? Link to comment
arezu Posted December 20, 2011 Share Posted December 20, 2011 if you would have used /debugscript 3, then you would have found out the problem(probably) teamChildNode = xmlCreateChild (teams, teamName) should be: teamChildNode = xmlCreateChild (teamXmlFile, teamName) because "teams" doesn't exist here as a xmlnode. 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