Jump to content

Need help with xml


ZenoS

Recommended Posts

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

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