Plate Posted January 27, 2013 Share Posted January 27, 2013 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 ) Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Pusiste 'fileWrite' y 'fileClose' despues de cerrar la funcion, ponelo antes del 'end'. Link to comment
Plate Posted January 27, 2013 Author Share Posted January 27, 2013 attempt to concatenate a boolean value Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 En que linea dice eso? Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Es porque getPlayerTeam devuelve un elemento, no un nombre. fileWrite( xml, "\""..getPlayerName(player).."\" team=\"".. getTeamName ( getPlayerTeam(player) ).."\"/> \n") Link to comment
Plate Posted January 27, 2013 Author Share Posted January 27, 2013 ahor me dice unfinished string name expected near > Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Lo copiaste mal seguramente. Link to comment
Alexs Posted January 27, 2013 Share Posted January 27, 2013 El XML seria ilegible ya que el root se llama igual que uno de los childrens. Link to comment
Plate Posted January 27, 2013 Author Share Posted January 27, 2013 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 Link to comment
Plate Posted January 28, 2013 Author Share Posted January 28, 2013 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) Link to comment
Recommended Posts