Plate Posted January 28, 2013 Share Posted January 28, 2013 Hola necesito que me digan como puedo 1 verificar desde este xml "[COD]Plate" team="Clan de prueba"/> el team del lider y que se abra el panel para ese team tambien como poner los players en ese team en una gridlist y como desde un edit poner el nombre de un player y agregarlo Link to comment
Alexs Posted January 28, 2013 Share Posted January 28, 2013 Si no me equivoco, se te hara un poco dificil por que el el parent ( y root ) se llama igual que los childrens, pero para leer usa: xmlNodeGetChildren --para conseguir todo lo que hay en el XML ( parent: Lideres ) xmlNodeGetAttribute --Para conseguir los valores en los childrens. y Para añadir cosas al XML usa: xmlNodeSetAttribute --Aunque yo no lo haría tan directo al XML. <Lideres name="[COD]Plate" team="Clan de prueba"/> </Lideres> Este XML esta mal, te falta abrir Lideres pues tienes un cierre de mas. Link to comment
Plate Posted January 29, 2013 Author Share Posted January 29, 2013 Asi? function HL(player, teamName) local theTeam = getTeamFromName ( teamName ) if ( theTeam ) then setPlayerTeam ( player , theTeam ) local xml = fileCreate ( "Lideres.xml" ) xmlNodeSetAttribute( xml, "\""..getPlayerName(player).."\" team=\""..getTeamName(getPlayerTeam(player)).."\"/> \n") fileWrite( xml, " \n" ) fileClose(xml) end end addEvent("HL", true) addEventHandler("HL", getRootElement(), HL) Link to comment
Alexs Posted January 29, 2013 Share Posted January 29, 2013 Lee los argumentos, estas poniendo algo que seria para escribir en un atributo, yo uso fileWrite por que me parece mejor, pero las funciones XML son las funciones XML. Link to comment
Recommended Posts