Alexs Posted July 20, 2012 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? Developer @ MYVAL
Castillo Posted July 20, 2012 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 20, 2012 Author Posted July 20, 2012 si convierto la tabla Alive.Players en una lista, serviria? Developer @ MYVAL
Castillo Posted July 20, 2012 Posted July 20, 2012 Simplemente aprende del ejemplo de la wiki. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 21, 2012 Author 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? Developer @ MYVAL
Castillo Posted July 21, 2012 Posted July 21, 2012 Ahi deberia funcionar. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts