Alexs Posted July 20, 2012 Share Posted July 20, 2012 Hola a Todos, este Script es el que Soren usara en el Paintball: grid = guiCreateGridList(0.8425,0.321111111,0.156875,0.536666667,true) columna = guiGridListAddColumn(grid,"Alive Players",1) function isPlayerAlive ( thePlayer ) return ( getElementHealth ( getLocalPlayer() ) >= 0 ) end function getAlivePlayersInTeam ( ) local alivePlayers = { } for index, player in ipairs ( getPlayersInTeam ( getPlayerTeam( localPlayer ) ) ) do if ( isPlayerAlive ( player ) ) then table.insert ( alivePlayers, player ) end end end Intentamos con eso para meterlos a un GUI con esto: local item = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, item, columna, getPlayerName (unpack( alivePlayers )), false, false ) Pero no funciona, alguna idea? Link to comment
Castillo Posted July 20, 2012 Share Posted July 20, 2012 local item = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, item, columna, getPlayerName (unpack( alivePlayers )), false, false ) Eso no tiene el menor sentido. Mira el ejemplo aca: https://wiki.multitheftauto.com/wiki/GuiGridListAddRow Link to comment
Alexs Posted July 20, 2012 Author Share Posted July 20, 2012 si convierto la tabla Alive.Players en una lista, serviria? Link to comment
Castillo Posted July 20, 2012 Share Posted July 20, 2012 Simplemente aprende del ejemplo de la wiki. Link to comment
Alexs Posted July 21, 2012 Author Share Posted July 21, 2012 function getAlivePlayersInTeam ( ) local alivePlayers = { } for index, player in ipairs ( getPlayersInTeam ( getPlayerTeam( localPlayer ) ) ) do if ( isPlayerAlive ( player ) ) then item = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, item, columna, getPlayerName (player), false, false ) end end end Que tal asi? Link to comment
Recommended Posts