Jump to content

[HELP] Can't solve gridlist


LabiVila

Recommended Posts

function wdw () 
    local PVPw = guiCreateWindow (0.25, 0.25, 0.50, 0.50, "PVP Window", true) 
    local playerList = guiCreateGridList (0.10, 0.10, 0.50, 0.85, true, PVPw) 
    guiWindowSetMovable (PVPw, false) 
    guiWindowSetSizable (PVPw, false) 
  
    amountL = guiCreateLabel (0.65, 0.10, 0.30, 0.10, "Cash ammount:", true, PVPw) 
    amount = guiCreateEdit (0.65, 0.17, 0.30, 0.10, "", true, PVPw) 
    amountLimit = guiCreateLabel (0.65, 0.28, 0.30, 0.10, "Limit: 99999$", true, PVPw) 
    guiLabelSetColor (amountLimit, 0, 255, 0) 
  
    roundsL = guiCreateLabel (0.65, 0.45, 0.30, 0.10, "Rounds", true, PVPw) 
    rounds = guiCreateEdit (0.65, 0.52, 0.30, 0.10, "", true, PVPw) 
    roundsLimit = guiCreateLabel (0.65, 0.63, 0.30, 0.10, "Limit: 8", true, PVPw) 
    guiLabelSetColor (roundsLimit, 0, 255, 0) 
  
    challb = guiCreateButton (0.65, 0.80, 0.30, 0.15, "Challenge", true, PVPw)  
end 
addEventHandler ("onClientResourceStart", getRootElement(), wdw) 
  
function playerListt () 
    local column = guiGridListAddColumn (playerList, "Player", 0.85, playerList) 
    if (column) then 
            for id, playeritem in ipairs (getElementsByType ("player")) do 
                local row = guiGridListAddRow (playerList) 
                guiGridListSetItemText (playerList, row, column, getPlayerName (playeritem), false, false) 
                local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) 
                outputChatBox (playerName) 
                end 
        end 
end 
addEventHandler ("onClientResourceStart", getRootElement(), playerListt) 
  

the outputChatBox doesn't work, what's wrong?

Link to comment
function wdw () 
    PVPw = guiCreateWindow (0.25, 0.25, 0.50, 0.50, "PVP Window", true) 
    guiWindowSetMovable (PVPw, false) 
    guiWindowSetSizable (PVPw, false) 
  
    playerList = guiCreateGridList (0.10, 0.10, 0.50, 0.85, true, PVPw) 
    guiGridListAddColumn (playerList, "Players List ...", 0.85) 
    for id, playeritem in ipairs (getElementsByType ("player")) do 
        local row = guiGridListAddRow (playerList) 
        guiGridListSetItemText (playerList, row, 1, getPlayerName (playeritem), false, false) 
        local playerName = guiGridListGetItemText ( playerList, row, 1 ) 
        outputChatBox ( tostring ( playerName ) ) 
    end 
    amountL = guiCreateLabel (0.65, 0.10, 0.30, 0.10, "Cash ammount:", true, PVPw) 
    amount = guiCreateEdit (0.65, 0.17, 0.30, 0.10, "", true, PVPw) 
    amountLimit = guiCreateLabel (0.65, 0.28, 0.30, 0.10, "Limit: 99999$", true, PVPw) 
    guiLabelSetColor (amountLimit, 0, 255, 0) 
  
    roundsL = guiCreateLabel (0.65, 0.45, 0.30, 0.10, "Rounds", true, PVPw) 
    rounds = guiCreateEdit (0.65, 0.52, 0.30, 0.10, "", true, PVPw) 
    roundsLimit = guiCreateLabel (0.65, 0.63, 0.30, 0.10, "Limit: 8", true, PVPw) 
    guiLabelSetColor (roundsLimit, 0, 255, 0) 
  
    challb = guiCreateButton (0.65, 0.80, 0.30, 0.15, "Challenge", true, PVPw) 
end 
addEventHandler ("onClientResourceStart", getRootElement(), wdw) 

Link to comment

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...