Jump to content

[GUI] onClientClick for Gridlist


Recommended Posts

Posted

i didn't get what you want ,

you want if player click on gridlist get the selected item that he clicked on ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

If they click on something in the list, it will call a function right away which in turn will load more information to display off to the side about what I have selected.

The main part is getting the function to trigger just by clicking on the glidlist item.

Posted

Yes.. Here is a little example that I made

local g = guiCreateGridList ( 0, 0, 100, 100, false ) 
guiGridListAddColumn ( g, "Column", 1 ) 
  
for i=1, 100 do  
    local r = guiGridListAddRow ( g ) 
    guiGridListSetItemText ( g, r, 1, tostring ( i ), false, false ) 
end 
  
  
addEventHandler ( "onClientGUIClick", g, function ( )  
    local r, c = guiGridListGetSelectedItem ( source ) 
    outputChatBox ( "You selected ".. tostring ( guiGridListGetItemText ( g, r, 1 ) ) ) 
end ) 

Posted
Yes.. Here is a little example that I made
local g = guiCreateGridList ( 0, 0, 100, 100, false ) 
guiGridListAddColumn ( g, "Column", 1 ) 
  
for i=1, 100 do  
    local r = guiGridListAddRow ( g ) 
    guiGridListSetItemText ( g, r, 1, tostring ( i ), false, false ) 
end 
  
  
addEventHandler ( "onClientGUIClick", g, function ( )  
    local r, c = guiGridListGetSelectedItem ( source ) 
    outputChatBox ( "You selected ".. tostring ( guiGridListGetItemText ( g, r, 1 ) ) ) 
end ) 

Thanks!

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