Jump to content

next Value in guiGridListGetSelectedItem


kuwalda

Recommended Posts

To understand what I mean, lets have a look at this picture:

3CaXuVd.jpg

I have 2 rows - Marka and Cena, which stands for Model and Price. If player selects any model from the list, I can get it using this function:

addEventHandler( "onClientGUIClick", root, 
function( ) 
    if ( source == carShop.gridlist[1] ) then 
    local row, col = guiGridListGetSelectedItem(carShop.gridlist[1]) 
        if ( row == -1 ) then return end 
        local text = guiGridListGetItemText(carShop.gridlist[1], row, col) 
        outputChatBox("BOOM:"..text.."", localPlayer, 255, 255, 255) 
    end 
end 
) 

The problem is - I know how to return model from it, but how can I return its Price?

For example, I have money calculator, which calculates how much money you will have after purchase.

I know the Model which player wants to buy, but how can I get its price, which is located in same section?

Link to comment

if ( guiGridListGetSelectedItem ( gridlist ) ~= -1 ) then 
    local Model = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) --- Select Model 
    local Price = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 2 ) --- Select Price 
end 
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...