Jump to content

Problema con XML


Plate

Recommended Posts

Posted

necesito ayuda me da bad file pointer @fileWrite y fileClose(1)

y tambien attempt to concatenate a user data valvue

server

function HL(player) 
    local xml = fileCreate ( "Lideres.xml" ) 
       fileWrite( xml, "\n" ) 
       fileWrite( xml, "\""..getPlayerName(player).."\" team=\""..getPlayerTeam(player).."\"/> \n") 
        end 
       fileWrite( xml, " \n" ) 
  fileClose(xml) 
addEvent("HL", true) 
addEventHandler("HL", getRootElement(), HL) 
  

client

function HLP() 
    local row, col = guiGridListGetSelectedItem ( teamList ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local team = guiGridListGetItemText ( teamList, row, columnA ) 
triggerServerEvent("HL", localPlayer, localPlayer, team) 
end 
end 
addEventHandler ( "onClientGUIClick", HL, HLP, false ) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Pusiste 'fileWrite' y 'fileClose' despues de cerrar la funcion, ponelo antes del 'end'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

En que linea dice eso?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Es porque getPlayerTeam devuelve un elemento, no un nombre.

fileWrite( xml, "\""..getPlayerName(player).."\" team=\"".. getTeamName ( getPlayerTeam(player) ).."\"/>  
\n") 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Lo copiaste mal seguramente.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Si le saco el getTeamName aparece el nombre del player pero ahora que me di cuenta en team tendria que ir el team del que el jugador es lider y no tengo ni idea de como obtenerlo

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Probe modificando mi codigo y sirvio pero ahora tengo un problema por que asi no me anda

function HL(player, teamName) 
local theTeam = getTeamFromName ( teamName ) 
        if ( theTeam ) then 
    setPlayerTeam ( player , theTeam ) 
    local xml = fileCreate ( "Lideres.xml" ) 
       fileWrite( xml, "\""..getPlayerName(player).."\" team=\""..getTeamName(getPlayerTeam(player)).."\"/> \n") 
       fileWrite( xml, " \n" ) 
       outputChatBox(getPlayerName(source) .." hizo lider y agrego a ".. getPlayerName(player).." a ".. getPlayerTeam(player).."", getRootElement(), 220, 255, 200) 
  fileClose(xml) 
   end 
end 
addEvent("HL", true) 
addEventHandler("HL", getRootElement(), HL) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...