Jump to content

getPlayersInTeam


Plate

Recommended Posts

Posted

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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Lo que yo quiero es poner los miembros de un team en una gridlist

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Entonces tenes que usar un for-loop con la tabla que devuelve getPlayersInTeam.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
for i, team in ipairs (getElementsByType("team")) do 

asi?

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No, te dije getPlayersInTeam, no lees?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
for i, v in ipairs (getPlayersInTeam(team)) do 
guiGridListSetItemText(members, row, mlist, v, false, false) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Si, pero tenes que obtener el team del nombre usando la funcion que ya te dije antes.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Funciona?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Nop me dice

expected string at argument 4 got table

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
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

Posted
Nop me dice

expected string at argument 4 got table

En esta linea?

guiGridListSetItemText(members, row, mlist, getPlayerName(v), false, false) 

Es impossible, porque getPlayerName devuelve un string.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Si solid en esa linea me da el error en el argumento 4

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Postea todo el script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...