Plate Posted January 27, 2013 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 ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Pusiste 'fileWrite' y 'fileClose' despues de cerrar la funcion, ponelo antes del 'end'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 attempt to concatenate a boolean value Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 En que linea dice eso? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 Linea 4 Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 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. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 ahor me dice unfinished string name expected near > Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Lo copiaste mal seguramente. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted January 27, 2013 Posted January 27, 2013 El XML seria ilegible ya que el root se llama igual que uno de los childrens. Developer @ MYVAL
Plate Posted January 27, 2013 Author 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 Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Plate Posted January 28, 2013 Author 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) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Recommended Posts