Jump to content

dxGridList problem


freudo

Recommended Posts

Posted

ı want list playerlist okey but list bug .D

if playerlist then 
    for id, player in ipairs(getElementsByType("player")) do 
            local playerName = getPlayerName(player) 
            local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
            table.insert(players, playerName) 
        end 
    end 

LoyNBj.png

Posted

no, one player

local players = {} 
  
    dxDrawGridList( (screenW - 251) / 2, (screenH - 254) / 2, 251, 254, 8, 70, core.language.dxGui.gridlist, players, true, false) 
    local playerlist = getElementData(core.language.dxGui.gridlist, "selected")[1] 
    if playerlist then 
    for id, player in ipairs(getElementsByType("player")) do 
            local playerName = getPlayerName(player) 
            local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
            table.insert(players, playerName) 
        end 
    end 

Posted

Sure if i dont help you so what i do ?

for i, val in ipairs(players) do  
if val ~= playerName then 
table.insert(players, playerName) end 
end 

Posted
local players = getElementsByType("player") 
    local playerName = getPlayerName(source) 
    for i, val in ipairs(players) do 
    if val ~= playerName then 
    table.insert(players, playerName) end 
    end 

nothing

Posted

please give me code

for id, player in ipairs(getElementsByType("player")) do 
    if player ~= playerName then 
            table.insert(players, playerName) 
    end 
    local playerName = getPlayerName(player) 
        local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
    end 

Posted

Cant i use phone ! Listen first take the first code that you give it to us second copy my code third past it after line 9 just before table.insert in you first code

Posted
for id, player in ipairs(getElementsByType("player")) do 
        local playerName = getPlayerName(player) 
        local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
        table.insert(players, playerName) 
    end 
    for i, val in ipairs(getElementsByType("player")) do 
    if val ~= playerName then 
    table.insert(players, playerName) end 
    end 

Posted
Delete line 4 and modify line 6 to for i, val in ipairs(players) do

past the code that draw the grid

Its obvious, it will draw the last player only!

Posted

nothing

for id, player in ipairs(getElementsByType("player")) do 
        local playerName = getPlayerName(player) 
        local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
    end 
    for i, val in ipairs(players) do 
    if val ~= playerName then 
    table.insert(players, playerName) end 
    end 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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