Plate Posted March 6, 2013 Share Posted March 6, 2013 Hola tengo una duda esto esta bien? function showmembers() local row = guiGridListAddRow(members) local row, col = guiGridListGetSelectedItem ( members ) if ( row and col and row ~= -1 and col ~= -1 ) then local team = guiGridListGetItemText ( members, row, mlist ) guiGridListSetItemText(members, row, mlist, getPlayersInTeam(team), false, false) end end addEventHandler("onClientGUIClick", showlist, showmembers, false) Link to comment
Renkon Posted March 6, 2013 Share Posted March 6, 2013 team es un objeto del tipo team, no un string ^^ Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 Como lo puedo hacer un string Renkon Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 Te lo dijo todo al reves, "team" en tu script es un string, supongo que el nombre de un team, lo que tenes que hacer es obtener el elemento del team usando: getTeamFromName Luego en guiGridListSetItemText, estas poniendo una tabla como texto, no creo que quieras hacer eso. Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 Lo que yo quiero es poner los miembros de un team en una gridlist Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 Entonces tenes que usar un for-loop con la tabla que devuelve getPlayersInTeam. Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 for i, team in ipairs (getElementsByType("team")) do asi? Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 No, te dije getPlayersInTeam, no lees? Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 for i, v in ipairs (getPlayersInTeam(team)) do guiGridListSetItemText(members, row, mlist, v, false, false) Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 Si, pero tenes que obtener el team del nombre usando la funcion que ya te dije antes. Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 function showmembers() local row, col = guiGridListGetSelectedItem ( clist ) if ( row and col and row ~= -1 and col ~= -1 ) then local team = guiGridListGetItemText ( clist, row, columnC ) for i, v in ipairs (getPlayersInTeam(getTeamFromName(team))) do local row = guiGridListAddRow(members) guiGridListSetItemText(members, row, mlist, getPlayerName(v), false, false) end end addEventHandler("onClientGUIClick", showlist, showmembers, false) Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 Nop me dice expected string at argument 4 got table Link to comment
Renkon Posted March 6, 2013 Share Posted March 6, 2013 Como lo puedo hacer un string Renkon Quise decir que el team que pide la funcion tiene que ser un elemento TEAM no un strnig. Me explique mal Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 Nop me diceexpected string at argument 4 got table En esta linea? guiGridListSetItemText(members, row, mlist, getPlayerName(v), false, false) Es impossible, porque getPlayerName devuelve un string. Link to comment
Plate Posted March 6, 2013 Author Share Posted March 6, 2013 Si solid en esa linea me da el error en el argumento 4 Link to comment
Plate Posted March 7, 2013 Author Share Posted March 7, 2013 Es demaciado largo te lo mando por pm Link to comment
Recommended Posts